diff src/com/five_ten_sg/connectbot/service/TerminalMonitor.java @ 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 f86f1e37b504
children 7e4352b53f24
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);