Skip to content

Commit

Permalink
Ternary!
Browse files Browse the repository at this point in the history
Syntax sweetener.

Co-authored-by: Anna Shaleva <shaleva.ann@gmail.com>
  • Loading branch information
roman-khimov and AnnaShaleva authored Sep 28, 2022
1 parent bbd3bdb commit 0a42fb2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Neo/SmartContract/ApplicationEngine.Storage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,7 @@ protected internal IIterator Find(StorageContext context, byte[] prefix, FindOpt
if ((options.HasFlag(FindOptions.PickField0) || options.HasFlag(FindOptions.PickField1)) && !options.HasFlag(FindOptions.DeserializeValues))
throw new ArgumentException(null, nameof(options));
byte[] prefix_key = StorageKey.CreateSearchPrefix(context.Id, prefix);
SeekDirection direction = SeekDirection.Forward;
if (options.HasFlag(FindOptions.Backwards))
direction = SeekDirection.Backward;
SeekDirection direction = options.HasFlag(FindOptions.Backwards) ? SeekDirection.Backward : SeekDirection.Forward;
return new StorageIterator(Snapshot.Find(prefix_key, direction).GetEnumerator(), prefix.Length, options);
}

Expand Down

0 comments on commit 0a42fb2

Please sign in to comment.