986 | | PackFile_Constant * const constant = interp->code->const_table->constants[k]; |
987 | | |
988 | | constant->type = PFC_STRING; |
989 | | constant->u.string = s; |
990 | | |
991 | | |
| 987 | int k = -1; |
| 988 | int i; |
| 989 | for (i = 0; i < table->const_count; ++i) { |
| 990 | PackFile_Constant * const constant = table->constants[i]; |
| 991 | if (constant->type == PFC_STRING) { |
| 992 | STRING * const sc = constant->u.string; |
| 993 | if (Parrot_charset_number_of_str(interp, s) == |
| 994 | Parrot_charset_number_of_str(interp, sc) && |
| 995 | Parrot_encoding_number_of_str(interp, s) == |
| 996 | Parrot_encoding_number_of_str(interp, sc) && |
| 997 | Parrot_str_equal(interp, s, sc)) { |
| 998 | k = i; |
| 999 | break; |
| 1000 | } |
| 1001 | } |
| 1002 | } |
| 1003 | if (k < 0) { |
| 1004 | PackFile_Constant * constant; |
| 1005 | k = add_const_table(interp); |
| 1006 | constant = table->constants[k]; |
| 1007 | constant->type = PFC_STRING; |
| 1008 | constant->u.string = s; |
| 1009 | } |