Commit 5386cd8a authored by Marc Gravell's avatar Marc Gravell

feedback from commit review

parent 420a024f
...@@ -125,16 +125,15 @@ internal RedisValue AsRedisValue() ...@@ -125,16 +125,15 @@ internal RedisValue AsRedisValue()
public void Recycle(int limit = -1) public void Recycle(int limit = -1)
{ {
var arr = _itemsOversized; var arr = _itemsOversized;
if (limit < 0) limit = _itemsCount;
if (arr != null) if (arr != null)
{ {
if (limit < 0) limit = _itemsCount;
for (int i = 0; i < limit; i++) for (int i = 0; i < limit; i++)
{ {
arr[i].Recycle(); arr[i].Recycle();
} }
} ArrayPool<RawResult>.Shared.Return(arr, clearArray: false);
if(_itemsOversized != null) }
ArrayPool<RawResult>.Shared.Return(_itemsOversized, clearArray: false);
} }
internal unsafe bool IsEqual(byte[] expected) internal unsafe bool IsEqual(byte[] expected)
......
...@@ -513,10 +513,10 @@ internal static RedisValue TryParse(object obj) ...@@ -513,10 +513,10 @@ internal static RedisValue TryParse(object obj)
case StorageType.Double: case StorageType.Double:
return value.OverlappedValueDouble; return value.OverlappedValueDouble;
case StorageType.String: case StorageType.String:
if (TryParseInt64((string)value._objectOrSentinel, out var f64)) return f64; if (Format.TryParseDouble((string)value._objectOrSentinel, out var f64)) return f64;
break; break;
case StorageType.Raw: case StorageType.Raw:
if (TryParseInt64(value._memory.Span, out f64)) return f64; if (TryParseDouble(value._memory.Span, out f64)) return f64;
break; break;
} }
throw new InvalidCastException(); throw new InvalidCastException();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment