aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/Colors.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2017-06-15 17:32:04 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2017-06-15 17:32:04 +0200
commit1fdbaaf4ae209e26ef8767ae13ebb9aa9d1f79c7 (patch)
tree5586932c635ca68a67bddcb83918b74ecad79758 /src/Colors.cs
parent570f6f9b7c9ed25adf618b02f5cfe0f1b3e9afe7 (diff)
Revert "replace foreach loops with for ones"
This reverts commit 1c3263454961eb207a01b67c51d0acf88376d522.
Diffstat (limited to 'src/Colors.cs')
-rw-r--r--src/Colors.cs17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/Colors.cs b/src/Colors.cs
index 89f5c932..3f200829 100644
--- a/src/Colors.cs
+++ b/src/Colors.cs
@@ -88,9 +88,10 @@ namespace Crow
if (c.Length == 1)
{
- for (int i = 0; i < ColorDic.Count; i++) {
- if (string.Equals(ColorDic [i].Name,s,StringComparison.Ordinal))
- return ColorDic [i];
+ foreach (Color cr in ColorDic)
+ {
+ if (string.Equals(cr.Name,s,StringComparison.Ordinal))
+ return cr;
}
}
return new Color(
@@ -1126,10 +1127,12 @@ namespace Crow
if (!string.IsNullOrEmpty(Name))
return Name;
- for (int i = 0; i < ColorDic.Count; i++) {
- if (ColorDic[i] == this) {
- Name = ColorDic[i].Name;
- return ColorDic[i].Name;
+ foreach (Color cr in ColorDic)
+ {
+ if (cr == this)
+ {
+ Name = cr.Name;
+ return cr.Name;
}
}