Skip to content

Commit e96ff72

Browse files
jywangxNreyab
authored andcommitted
Fix the bug in function opal_list_insert
Fix the bug that calls to opal_list_insert() with idx=0 will make list->opal_list_length increase twice. Signed-off-by: Jinyuan Wang <wangjingyuan@mail.nwpu.edu.cn>
1 parent 8113e7c commit e96ff72

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

opal/class/opal_list.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ bool opal_list_insert(opal_list_t *list, opal_list_item_t *item, long long idx)
135135
assert(1 == item->opal_list_item_refcount);
136136
item->opal_list_item_belong_to = list;
137137
#endif
138+
list->opal_list_length++;
138139
}
139140

140-
list->opal_list_length++;
141141
return true;
142142
}
143143

0 commit comments

Comments
 (0)