mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
There was endless loop due to my refactoring
This commit is contained in:
@@ -45,10 +45,14 @@ public class ReadDraftRankings {
|
|||||||
|
|
||||||
final Map<String, Map<String, Integer>> map = new HashMap<String, Map<String, Integer>>();
|
final Map<String, Map<String, Integer>> map = new HashMap<String, Map<String, Integer>>();
|
||||||
for( String line : FileUtil.readFile(file)) {
|
for( String line : FileUtil.readFile(file)) {
|
||||||
|
|
||||||
// stop reading if end of file or blank line is read
|
// stop reading if end of file or blank line is read
|
||||||
while ((line != null) && (line.trim().length() != 0)) {
|
if(line == null || line.length() == 0) {
|
||||||
if (!line.startsWith(ReadDraftRankings.COMMENT)) {
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (line.startsWith(ReadDraftRankings.COMMENT)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
final String[] s = line.split("\\|");
|
final String[] s = line.split("\\|");
|
||||||
final String rankStr = s[0].trim().substring(1);
|
final String rankStr = s[0].trim().substring(1);
|
||||||
final String name = s[1].trim().replaceAll("-", " ").replaceAll("[^A-Za-z ]", "");
|
final String name = s[1].trim().replaceAll("-", " ").replaceAll("[^A-Za-z ]", "");
|
||||||
@@ -70,8 +74,6 @@ public class ReadDraftRankings {
|
|||||||
Log.warn("NumberFormatException: " + nfe.getMessage());
|
Log.warn("NumberFormatException: " + nfe.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // if
|
|
||||||
}
|
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
} // readFile()
|
} // readFile()
|
||||||
|
|||||||
Reference in New Issue
Block a user