Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-288036: quick fix for "Possible multiple enumeration of IEnumerable"

$
0
0
Reporter Jakub Jiricek (jakub.jiricek@vodafone.com) Jakub Jiricek (jakub.jiricek@vodafone.com)
Created Jan 27, 2012 3:20:01 PM
Updated Jan 27, 2012 3:20:01 PM
Priority Show-stopper
Type Feature
Fix versions No Fix versions
State Open
Assignee Sergey Coox (coox)
Subsystem Quick Fixes
Affected versions No Affected versions
Fixed in build No Fixed in build
currently R# does not offer a quick-fix for this. I am not sure whether it is possible always, but in many cases (e.g. when the IEnumerable is being passed as a method argument and is not being modified inside the method) these options might work for IEnumerable<T> ienum:

  • using an auxiliary variable T[] ienumToArray = ienum.ToArray();
  • using an auxiliary variable List<T> ienumToList = ienum.ToList();
  • using an auxiliary variable ReadOnlyCollection<T> ienumToROC = ienum.ToList().AsReadOnly();
or perhaps some other as well...

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>