Skip to content

Commit 1ee555a

Browse files
author
rstam
committed
Removed some optimizations that didn't turn out to actually help.
1 parent 2d3832e commit 1ee555a

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

Bson/IO/BsonBuffer.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -972,11 +972,9 @@ private static string DecodeUtf8String(byte[] buffer, int index, int count)
972972
// special case single character strings
973973
case 1:
974974
var byte1 = buffer[index];
975-
// enable the .Net CLR to eliminate an array bounds check on __asciiStringTable
976-
var asciiStringTable = __asciiStringTable;
977-
if (byte1 < asciiStringTable.Length)
975+
if (byte1 < __asciiStringTable.Length)
978976
{
979-
return asciiStringTable[byte1];
977+
return __asciiStringTable[byte1];
980978
}
981979
break;
982980
}

Bson/IO/BsonTrie.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,12 @@ public BsonTrieNode<TValue> GetChild(byte keyByte)
193193
else if (_children != null)
194194
{
195195
var index = (uint)((int)keyByte - _minChildKeyByte);
196-
// enable the .Net CLR to eliminate an array bounds check on _keyByteIndexes
197-
var childrenIndexes = _childrenIndexes;
198-
if (index < childrenIndexes.Length)
196+
if (index < _childrenIndexes.Length)
199197
{
200-
index = childrenIndexes[index];
201-
// enable the .Net CLR to eliminate an array bounds check on _children
202-
var children = _children;
203-
if (index < children.Length)
198+
index = _childrenIndexes[index];
199+
if (index < _children.Length)
204200
{
205-
return children[index];
201+
return _children[index];
206202
}
207203
}
208204
}

0 commit comments

Comments
 (0)