Skip to content

Commit e35eab4

Browse files
memberOf plugin: swap instead of a shift
when removing a duplicate. DNs order doesn't matter.
1 parent 2467b86 commit e35eab4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/ldb_modules/memberof.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -825,9 +825,7 @@ static int mbof_add_operation(struct mbof_add_operation *addop)
825825
}
826826
if (j < parents->num) {
827827
/* remove duplicate */
828-
for (;j+1 < parents->num; j++) {
829-
parents->dns[j] = parents->dns[j+1];
830-
}
828+
parents->dns[j] = parents->dns[parents->num - 1];
831829
parents->num--;
832830
}
833831
}

0 commit comments

Comments
 (0)