Skip to content

Commit

Permalink
Merge pull request #41 from nesheep5/master
Browse files Browse the repository at this point in the history
modelListガード節をStringBuilder作成後に移動
  • Loading branch information
jswaf committed Mar 9, 2017
2 parents d10b446 + 69c0eff commit 3b77573
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions contents/066/answer/README.md
Expand Up @@ -17,14 +17,14 @@ public class Knock066 {
private Knock066() {};

public static String convertToString(List<Model> modelList) {
//String result = "";
StringBuilder result = new StringBuilder(); // 修正箇所. #4

// modelListがnullでないことを保証. #1
if (modelList == null) {
return result;
return result.toString();
}

//String result = "";
StringBuilder result = new StringBuilder(); // 修正箇所. #4


for (Model model : modelList) {
// Modelオブジェクトがnullの場合はスキップ. #2
if (model != null) {
Expand Down Expand Up @@ -70,4 +70,4 @@ public class Knock066 {
return result.toString();
}
}
```
```

0 comments on commit 3b77573

Please sign in to comment.