Skip to content
Snippets Groups Projects
Commit 3ce277cc authored by Howard Chu's avatar Howard Chu Committed by Quanah Gibson-Mount
Browse files

ITS#7231 simplify prev commit

parent 9fa69b67
No related branches found
No related tags found
No related merge requests found
...@@ -1357,6 +1357,10 @@ int bdb_idl_append( ID *a, ID *b ) ...@@ -1357,6 +1357,10 @@ int bdb_idl_append( ID *a, ID *b )
return 0; return 0;
} }
if ( b[0] == 1 ) {
return bdb_idl_append_one( a, BDB_IDL_FIRST( b ));
}
ida = BDB_IDL_LAST( a ); ida = BDB_IDL_LAST( a );
idb = BDB_IDL_LAST( b ); idb = BDB_IDL_LAST( b );
if ( BDB_IDL_IS_RANGE( a ) || BDB_IDL_IS_RANGE(b) || if ( BDB_IDL_IS_RANGE( a ) || BDB_IDL_IS_RANGE(b) ||
...@@ -1367,7 +1371,7 @@ int bdb_idl_append( ID *a, ID *b ) ...@@ -1367,7 +1371,7 @@ int bdb_idl_append( ID *a, ID *b )
return 0; return 0;
} }
if ( b[0] > 1 && ida > idb ) { if ( ida > idb ) {
swap = idb; swap = idb;
a[a[0]] = idb; a[a[0]] = idb;
b[b[0]] = ida; b[b[0]] = ida;
...@@ -1377,17 +1381,12 @@ int bdb_idl_append( ID *a, ID *b ) ...@@ -1377,17 +1381,12 @@ int bdb_idl_append( ID *a, ID *b )
tmp = a[1]; tmp = a[1];
a[1] = b[1]; a[1] = b[1];
} else { } else {
if (b[1] < ida) { tmp = b[1];
tmp = a[a[0]];
a[a[0]] = b[1];
} else {
tmp = b[1];
}
} }
a[0]++; a[0]++;
a[a[0]] = tmp; a[a[0]] = tmp;
if ( b[0] > 1 ) { {
int i = b[0] - 1; int i = b[0] - 1;
AC_MEMCPY(a+a[0]+1, b+2, i * sizeof(ID)); AC_MEMCPY(a+a[0]+1, b+2, i * sizeof(ID));
a[0] += i; a[0] += i;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment