Follow up #1172 #1849: Fix cache issue. IP filtering helpers#1221
Follow up #1172 #1849: Fix cache issue. IP filtering helpers#1221nurhat wants to merge 5 commits intoThreeMammals:developfrom
Conversation
|
Any update on when we might get this? |
Cherry picked from ThreeMammals#1221
|
@nurhat Wish you good luck during code review! And once again, |
Mohsen, could you review the code please? |
|
@garybond commented on Feb 10, 2021:
Coming soon... 😃 |
| return string.Empty; | ||
| } | ||
|
|
||
| public static List<string> SplitCsv(this string csvList, bool nullOrWhitespaceInputReturnsNull = false) |
There was a problem hiding this comment.
...till the moment the author will write at least one unit test for this method. 🤣
There was a problem hiding this comment.
unless no one uses it outside of this class
| return string.Empty; | ||
| } | ||
|
|
||
| public static List<string> SplitCsv(this string csvList, bool nullOrWhitespaceInputReturnsNull = false) |
There was a problem hiding this comment.
| public static List<string> SplitCsv(this string csvList, bool nullOrWhitespaceInputReturnsNull = false) | |
| private static IReadOnlyCollection<string> SplitCsv(this string csvList, bool nullOrWhitespaceInputReturnsNull = false) |
There was a problem hiding this comment.
Ensuring about strong safety by IReadOnlyCollection and making the method private don't give much outcome by having it as read-only.
There was a problem hiding this comment.
this method is only use in this class, so, it must be private. There will always be time to make it public, if necessary
| { | ||
| if (string.IsNullOrWhiteSpace(csvList)) | ||
| { | ||
| return nullOrWhitespaceInputReturnsNull ? null : new List<string>(); |
There was a problem hiding this comment.
| return nullOrWhitespaceInputReturnsNull ? null : new List<string>(); | |
| return nullOrWhitespaceInputReturnsNull ? null : Array.Empty<string>(); |
| .Split(',') | ||
| .AsEnumerable() | ||
| .Select(s => s.Trim()) | ||
| .ToList(); |
There was a problem hiding this comment.
| .ToList(); | |
| .ToArray(); |
There was a problem hiding this comment.
@RaynaldM
Why to array?
The author just wants to match the returning type which is List<string>😄
Are you kidding? 😉 He will get compilation error. 🤣
There was a problem hiding this comment.
if @nurhat applies all these changes no problems compiling.
I always recommend the use of Single-Dimensional Array because it is the most sober in memory and cpu.
If we don't need more functions, like in lists and other dictionaries, then let's use the simpler and more sober one
|
@RaynaldM Ray, |
c216cdf to
b458f0f
Compare
2e07528 to
33e9c23
Compare
Proposed Changes
CacheKeyGenerator