Skip to content

Commit 81561bf

Browse files
committed
minor refactoring
1 parent 0635621 commit 81561bf

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Asn1Parser/Asn1Utils.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,11 @@ public static ReadOnlyMemory<Byte> Encode(ReadOnlySpan<Byte> rawData, Byte enclo
122122
Byte[] retValue = new Byte[1 + pbHeader.Length + rawData.Length];
123123
// copy L component to destination array
124124
retValue[0] = enclosingTag;
125+
Int32 shift = 1;
125126
for (Int32 i = 0; i < pbHeader.Length; i++) {
126-
retValue[i + 1] = pbHeader[i];
127+
retValue[i + shift] = pbHeader[i];
127128
}
128-
Int32 shift = 1 + pbHeader.Length;
129+
shift += pbHeader.Length;
129130
// copy V component to destination array
130131
for (Int32 i = 0; i < rawData.Length; i++) {
131132
retValue[i + shift] = rawData[i];

0 commit comments

Comments
 (0)