Timeline for Efficiently remove duplicate elements from the list
Current License: CC BY-SA 4.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 2, 2020 at 18:49 | vote | accept | AndyP | ||
Nov 1, 2020 at 1:59 | comment | added | AndyP | Can you update this in your answer as well please if possible? | |
Nov 1, 2020 at 1:57 | comment | added | Icepickle | @AndyP yes, wrap it inside the usings or use a local using statement | |
Nov 1, 2020 at 1:54 | comment | added | AndyP |
I apologize about this as I should have added this in earlier. Now with that detail can we still use your suggestion or we need to change it? If yes, then how I can wrap around using block in your suggestion? Will it be wrapped around var responses block?
|
|
Nov 1, 2020 at 1:53 | comment | added | AndyP |
After checking your answer which I think is really good I was gonna try integrating in my solution but I realize one thing. I removed one thing from my original code which I thought is not relevant here but looking at your answer now I am confuse on how to have that in your suggestion. So I updated my question to provide my full code which has this line using (var logMetric = new LogMetric(_logger, TITLE, "DatabaseCall")) wrapped around my first for loop.
|
|
Nov 1, 2020 at 0:52 | comment | added | Icepickle |
@AndyP, No you shouldn't have a problem there, id is already local because of the lambda in select
|
|
Nov 1, 2020 at 0:31 | comment | added | AndyP |
Thanks for your suggestion. I can update my question which has ProcessData method as well so that it can clear your confusion if needed but I have a question on your suggestion. Will this have any problem related to closure issue? Earlier I had closure issue with my original code so that's why I needed to initialize variable like this - var id = ids[i]; to fix that so just making sure your suggestion will not have same problem?
|
|
Nov 1, 2020 at 0:09 | history | answered | Icepickle | CC BY-SA 4.0 |