@@ -755,26 +755,25 @@ public String translate(String self, PDict table,
755755 return new String (translatedChars );
756756 }
757757
758- private static String translateFromByteTable (String text , Object table , BytesNodes . ToBytesNode toBytesNode ) {
758+ private static String translateFromByteTable (String text , byte [] table ) {
759759 byte [] translatedChars = text .getBytes ();
760- byte [] byteTable = toBytesNode .execute (table );
761760 for (int i = 0 ; i < translatedChars .length ; i ++) {
762761 byte original = translatedChars [i ];
763- translatedChars [i ] = byteTable [original ];
762+ translatedChars [i ] = table [original ];
764763 }
765764 return new String (translatedChars );
766765 }
767766
768767 @ Specialization
769768 public String translate (String self , PIBytesLike table ,
770769 @ Cached ("create()" ) BytesNodes .ToBytesNode getBytesNode ) {
771- return translateFromByteTable (self , table , getBytesNode );
770+ return translateFromByteTable (self , getBytesNode . execute ( table ) );
772771 }
773772
774773 @ Specialization
775774 public String translate (String self , PMemoryView table ,
776775 @ Cached ("create()" ) BytesNodes .ToBytesNode getBytesNode ) {
777- return translateFromByteTable (self , table , getBytesNode );
776+ return translateFromByteTable (self , getBytesNode . execute ( table ) );
778777 }
779778
780779 }
0 commit comments