Skip to content

Commit

Permalink
Optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzhang committed Jan 26, 2021
1 parent 2341c89 commit a306a29
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/neo/SmartContract/Native/OracleContract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,7 @@ public OracleRequest GetRequest(DataCache snapshot, ulong id)

public IEnumerable<(ulong, OracleRequest)> GetRequests(DataCache snapshot)
{
return snapshot.Find(CreateStorageKey(Prefix_Request).ToArray())
.Select(p => (BitConverter.IsLittleEndian ?
BinaryPrimitives.ReverseEndianness(BitConverter.ToUInt64(p.Key.Key, 1)) :
BitConverter.ToUInt64(p.Key.Key, 1), p.Value.GetInteroperable<OracleRequest>()));
return snapshot.Find(CreateStorageKey(Prefix_Request).ToArray()).Select(p => (BinaryPrimitives.ReadUInt64BigEndian(p.Key.Key.AsSpan(1)), p.Value.GetInteroperable<OracleRequest>()));
}

public IEnumerable<(ulong, OracleRequest)> GetRequestsByUrl(DataCache snapshot, string url)
Expand Down

0 comments on commit a306a29

Please sign in to comment.