changeset 210:af235340fcde

use array copy rather than loops
author Carl Byington <carl@five-ten-sg.com>
date Mon, 07 Jul 2014 09:57:13 -0700
parents 53f66625d618
children 7e4352b53f24
files src/com/five_ten_sg/connectbot/service/TerminalMonitor.java
diffstat 1 files changed, 2 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/com/five_ten_sg/connectbot/service/TerminalMonitor.java	Thu Jul 03 19:54:05 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/service/TerminalMonitor.java	Mon Jul 07 09:57:13 2014 -0700
@@ -400,23 +400,14 @@
     public synchronized void setField(int l, int c, char[] data, int offset) {
         Log.i(TAG, "setField()");
         char[] da = new char[data.length - offset];
-        int i;
-
-        for (i = 0; i < da.length; i++) {
-            da[i] = data[i + offset];
-        }
-
+        System.arraycopy(data, offset, da, 0, data.length-offset);
         buffer.setField(l, c, da);
     }
 
     public synchronized void showUrl(char [] data, int offset) {
         Log.i(TAG, "setField()");
         char[] da = new char[data.length - offset];
-        int i;
-
-        for (i = 0; i < da.length; i++) {
-            da[i] = data[i + offset];
-        }
+        System.arraycopy(data, offset, da, 0, data.length-offset);
         String url = new String(da);
         Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
         parent.startActivity(intent);