mirror of
https://github.com/lc-soft/LCUI.git
synced 2026-11-30 16:48:21 +01:00
优化字符串组的元素删除操作
This commit is contained in:
@@ -204,11 +204,13 @@ static int strsdelone( char ***strlist, const char *str )
|
||||
for( pos = -1, i = 0; (*strlist)[i]; ++i ) {
|
||||
if( strcmp( (*strlist)[i], str ) == 0 ) {
|
||||
pos = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( pos == -1 ) {
|
||||
return 0;
|
||||
}
|
||||
for( ; (*strlist)[i]; ++i );
|
||||
if( pos == 0 && i < 2 ) {
|
||||
free( *strlist );
|
||||
*strlist = NULL;
|
||||
|
||||
Reference in New Issue
Block a user