remove shuffle and replace with random index call to improve performance

This commit is contained in:
John Bush
2013-02-15 22:54:02 -07:00
parent 0ce50126b6
commit c51f0ef359
@@ -151,8 +151,11 @@ public class Faker {
// lorem
public List<String> words(int num) {
List<String> words = (List<String>) fetchObject("lorem.words");
Collections.shuffle(words);
return words.subList(0, num);
List<String> returnList = new ArrayList();
for (int i=0; i< num;i++) {
returnList.add(words.get(nextInt(words.size())));
}
return returnList;
}
public List<String> words() {