Conversation
Codecov Report
@@ Coverage Diff @@
## master #947 +/- ##
==========================================
+ Coverage 45.39% 45.72% +0.33%
==========================================
Files 178 178
Lines 12662 12732 +70
==========================================
+ Hits 5748 5822 +74
+ Misses 6914 6910 -4
Continue to review full report at Codecov.
|
neo/IO/Caching/DataCache.cs
Outdated
| { | ||
| lock (dictionary) | ||
| { | ||
| return FindUnsorted(key_prefix).OrderBy(u => u.Key, this); |
There was a problem hiding this comment.
This forces the entire set of search results to be loaded into memory for sorting, which can lead to attacks.
There was a problem hiding this comment.
Still nowadays I have dificulties with C#.
Looking at it I would think that it finds and returns the set, then, it sorts the results.
In this sense, maybe it needs to be split into two steps, right, @erikzhang?
There was a problem hiding this comment.
We need to do some optimization. Because the records read from the underlying storage (leveldb) is already sorted.
There was a problem hiding this comment.
Perfect, master.
We are going to reflect on that and think about an efficient way.
There was a problem hiding this comment.
I will propose another way
|
|
||
| // We need to return a, b and cached results between them | ||
|
|
||
| if (a.Key == null && a.Value == null) |
There was a problem hiding this comment.
ReferenceEquals(a,n) doesn't work :S
Close #946