From 3cbb978d51ce694c941671f8bc4efd673d80e4e0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Mar 2003 18:01:59 +0400 Subject: stringcmp() and sortcmp() have been unified into the only one sortcmp() with additional CHARSET_INFO *cmp_charset argument. --- sql/sql_string.cc | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'sql/sql_string.cc') diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 21e38397842..1a0366112f4 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -538,30 +538,14 @@ void String::qs_append(const char &c) } -int sortcmp(const String *x,const String *y) +int sortcmp(const String *x,const String *y, CHARSET_INFO *cs) { - CHARSET_INFO *cs= x->str_charset; return cs->strnncollsp(cs, (unsigned char *) x->ptr(),x->length(), (unsigned char *) y->ptr(),y->length()); } -int stringcmp(const String *x,const String *y) -{ - const char *s= x->ptr(); - const char *t= y->ptr(); - uint32 x_len=x->length(),y_len=y->length(),len=min(x_len,y_len); - - while (len--) - { - if (*s++ != *t++) - return ((int) (uchar) s[-1] - (int) (uchar) t[-1]); - } - return (int) (x_len-y_len); -} - - String *copy_if_not_alloced(String *to,String *from,uint32 from_length) { if (from->Alloced_length >= from_length) -- cgit v1.2.1