diff src/org/tn5250j/framework/tn5250/Screen5250.java @ 108:ae3092cd9cbf

use hash map rather than linear search thru arrays
author Carl Byington <carl@five-ten-sg.com>
date Wed, 18 Jun 2014 12:00:45 -0700
parents afe6962769b9
children 6a0ad4d384ea
line wrap: on
line diff
--- a/src/org/tn5250j/framework/tn5250/Screen5250.java	Wed Jun 18 11:43:08 2014 -0700
+++ b/src/org/tn5250j/framework/tn5250/Screen5250.java	Wed Jun 18 12:00:45 2014 -0700
@@ -34,9 +34,10 @@
 import java.util.Vector;
 
 import org.tn5250j.TN5250jConstants;
+
 import android.util.Log;
+import de.mud.terminal.VDUBuffer;
 import de.mud.terminal.vt320;
-import de.mud.terminal.VDUBuffer;
 
 
 public class Screen5250 {
@@ -560,7 +561,7 @@
      * @return key value of Mnemonic
      */
     private int getMnemonicValue(String mnem) {
-        if (mnemonicMap.containsKey(mnem)) return mnemonicsMap.get(mnem);
+        if (mnemonicMap.containsKey(mnem)) return mnemonicMap.get(mnem);
         return 0;
     }
 
@@ -3841,10 +3842,10 @@
                 char at = planes.getCharExtended(p);
                 boolean ia = planes.isAttributePlace(p);
                 if (ch < ' ') ch = ' ';
-                int bg = vt320color[(int)((co >> 8) & 0x0f)] + 1;
-                int fg = vt320color[(int)(co        & 0x0f)] + 1;
-                int ul = (int)(at & EXTENDED_5250_UNDERLINE);
-                int nd = (int)(at & EXTENDED_5250_NON_DSP);
+                int bg = vt320color[(co >> 8) & 0x0f] + 1;
+                int fg = vt320color[co        & 0x0f] + 1;
+                int ul = at & EXTENDED_5250_UNDERLINE;
+                int nd = at & EXTENDED_5250_NON_DSP;
                 int vt_attr = (fg << VDUBuffer.COLOR_FG_SHIFT) + (bg << VDUBuffer.COLOR_BG_SHIFT);
                 if (ul > 0) vt_attr |= VDUBuffer.UNDERLINE;
                 if (ia || (nd > 0)) vt_attr |= VDUBuffer.INVISIBLE;