gora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lewi...@apache.org
Subject [4/7] gora git commit: Performance improvements.
Date Sat, 05 Sep 2015 14:47:08 GMT
Performance improvements.


Project: http://git-wip-us.apache.org/repos/asf/gora/repo
Commit: http://git-wip-us.apache.org/repos/asf/gora/commit/1507a59a
Tree: http://git-wip-us.apache.org/repos/asf/gora/tree/1507a59a
Diff: http://git-wip-us.apache.org/repos/asf/gora/diff/1507a59a

Branch: refs/heads/master
Commit: 1507a59a12928080401fd00c9114790905c912dc
Parents: 5389d0b
Author: Furkan KAMACI <furkankamaci@gmail.com>
Authored: Fri Sep 4 16:40:16 2015 +0300
Committer: Furkan KAMACI <furkankamaci@gmail.com>
Committed: Fri Sep 4 16:40:16 2015 +0300

----------------------------------------------------------------------
 .../java/org/apache/gora/examples/WebPageDataCreator.java       | 4 +---
 gora-core/src/main/java/org/apache/gora/util/StringUtils.java   | 5 +++--
 2 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/gora/blob/1507a59a/gora-core/src/examples/java/org/apache/gora/examples/WebPageDataCreator.java
----------------------------------------------------------------------
diff --git a/gora-core/src/examples/java/org/apache/gora/examples/WebPageDataCreator.java
b/gora-core/src/examples/java/org/apache/gora/examples/WebPageDataCreator.java
index 201bdde..cd933d5 100644
--- a/gora-core/src/examples/java/org/apache/gora/examples/WebPageDataCreator.java
+++ b/gora-core/src/examples/java/org/apache/gora/examples/WebPageDataCreator.java
@@ -105,9 +105,7 @@ public class WebPageDataCreator {
 
   public static final String[] SORTED_URLS = new String[URLS.length];
   static {
-    for (int i = 0; i < URLS.length; i++) {
-      SORTED_URLS[i] = URLS[i];
-    }
+    System.arraycopy(URLS, 0, SORTED_URLS, 0, URLS.length);
     Arrays.sort(SORTED_URLS);
   }
   

http://git-wip-us.apache.org/repos/asf/gora/blob/1507a59a/gora-core/src/main/java/org/apache/gora/util/StringUtils.java
----------------------------------------------------------------------
diff --git a/gora-core/src/main/java/org/apache/gora/util/StringUtils.java b/gora-core/src/main/java/org/apache/gora/util/StringUtils.java
index 5ffdaad..75c03cd 100644
--- a/gora-core/src/main/java/org/apache/gora/util/StringUtils.java
+++ b/gora-core/src/main/java/org/apache/gora/util/StringUtils.java
@@ -19,6 +19,7 @@
 package org.apache.gora.util;
 
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.List;
@@ -34,8 +35,8 @@ public class StringUtils {
    */
   public static String[] joinStringArrays(String[] arr1, String... arr2) {
     HashSet<String> set = new HashSet<String>();
-    for(String str : arr1) set.add(str);
-    for(String str : arr2) set.add(str);
+    Collections.addAll(set, arr1);
+    Collections.addAll(set, arr2);
 
     return set.toArray(new String[set.size()]);
   }


Mime
View raw message