title: Why does ReSharper suggest I convert a for loop into a LINQ expression?
body: <p>In Visual Studio Re-Sharper keeps recommending I convert a for loop to a linq expression but what is the reason for this? </p>
  
  <p>Which is faster?</p>
  
  <p>Here are some example loops where resharper suggests a linq conversion:</p>
  
  <pre><code>foreach (XmlNode legendEntryNode in _legendEntryNodes)
  {
      var xmlElement = legendEntryNode["FeatureType"];
  
      if (xmlElement == null || !xmlElement.InnerText.Equals(featuretype)) continue;
  
      var xmlNodeList = legendEntryNode.SelectNodes("Themes/Theme");
  
      if (xmlNodeList != null)
  
      foreach (XmlNode themeNode in xmlNodeList)
      {
          var element = themeNode["Value"];
  
          if (element == null || !element.InnerText.Equals(v)) continue;
  
          var xmlElement1 = themeNode["Icon"];
  
          if (xmlElement1 != null)
          {
              string iconname = "&lt;ms:ICON&gt;" + xmlElement1.InnerText + "&lt;/ms:ICON&gt;";
  
              var element1 = themeNode["Highlight"];
  
              if (element1 != null)
              {
                  string highlightname = "&lt;ms:HIGHLIGHT&gt;" + element1.InnerText + "&lt;/ms:HIGHLIGHT&gt;";
                  gml = gml.Insert(c, iconname + highlightname);
  
                  c += (iconname.Length + highlightname.Length);
              }
          }
          break;
      }
  }
  </code></pre>
  
  <p>And this simpler example:</p>
  
  <pre><code>for (int i = 0; i &lt; getPointsRequest.Attribs.Length; i++)
  {
      string attribName = getPointsRequest.Attribs[i].AttributeName;
  
      if (!String.IsNullOrEmpty(attribName))
      {
          sqlQuery += "&lt;ms:" + attribName + "&gt;||\"" + attribName + "\"||&lt;/ms:" + attribName + "&gt;";
      }
  }
  </code></pre>