View | Details | Raw Unified | Return to bug 16885
Collapse All | Expand All

(-)src/main/unique.c (-1 / +1 lines)
Lines 861-867 Link Here
861
      switch (type) {
861
      switch (type) {
862
      case STRSXP: {
862
      case STRSXP: {
863
	  SEXP x_val = STRING_ELT(x,0);
863
	  SEXP x_val = STRING_ELT(x,0);
864
	  for (int i=0; i < LENGTH(itable); i++) if (STRING_ELT(table,i) == x_val) {
864
	  for (int i=0; i < LENGTH(itable); i++) if (Seql(STRING_ELT(table,i), x_val)) {
865
		  INTEGER(ans)[0] = i + 1; break;
865
		  INTEGER(ans)[0] = i + 1; break;
866
	      }
866
	      }
867
	  break; }
867
	  break; }
(-)tests/reg-tests-3.R (+13 lines)
Lines 196-198 Link Here
196
nchar(x, "c", allowNA = TRUE)
196
nchar(x, "c", allowNA = TRUE)
197
nchar(x, "w", allowNA = TRUE)
197
nchar(x, "w", allowNA = TRUE)
198
## Results differed by platform, but some gave incorrect results on string 10.
198
## Results differed by platform, but some gave incorrect results on string 10.
199
200
201
## Match fast path for length 1 x, where only string encoding differs
202
tmp <- "年付"
203
tmp2 <- "\u5e74\u4ed8"
204
Encoding(tmp) <- "UTF-8"
205
stopifnot(tmp %in% tmp2)
206
207
tmp <- "foo"
208
tmp2 <- "foo"
209
Encoding(tmp) <- "unknown"
210
Encoding(tmp2) <- "UTF-8"
211
stopifnot(tmp %in% tmp2)

Return to bug 16885