Browse Source

added one more efficiency

Luis Romero 6 years ago
parent
commit
c79c69a077
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      src/main/java/com/zipcodewilmington/phonebook/PhoneBook.java

+ 3
- 2
src/main/java/com/zipcodewilmington/phonebook/PhoneBook.java View File

@@ -44,8 +44,9 @@ public class PhoneBook {
44 44
         StringBuilder sb = new StringBuilder();
45 45
 
46 46
         for (String key : treeMap.keySet()) {
47
-            sb.append(treeMap.get(key).getName() + "\n");
48
-            sb.append(treeMap.get(key).getPhoneNumberListString());
47
+            Person p = treeMap.get(key);
48
+            sb.append(p.getName() + "\n");
49
+            sb.append(p.getPhoneNumberListString() + "\n");
49 50
         }
50 51
 
51 52
         return sb;