From 426ef0b9515cc14e34ec0f6ef2ce13f7d9e9ec4b Mon Sep 17 00:00:00 2001 From: Alexandra Ellwood Date: Tue, 18 Sep 2007 19:48:19 +0000 Subject: [PATCH] cci_array_move should work when the source and dest positions are equal Fixed so it does nothing when moving an element to its own index. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19950 dc483132-0cff-0310-8789-dd5450dbe970 --- src/ccapi/common/cci_array_internal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ccapi/common/cci_array_internal.c b/src/ccapi/common/cci_array_internal.c index 3d1e35ef3..37ff695e3 100644 --- a/src/ccapi/common/cci_array_internal.c +++ b/src/ccapi/common/cci_array_internal.c @@ -270,7 +270,8 @@ cc_int32 cci_array_move (cci_array_t io_array, move_to = in_position; move_count = in_new_position - in_position - 1; real_new_position = in_new_position - 1; - } else { + + } else if (in_position > in_new_position) { /* shift left */ move_from = in_new_position; move_to = in_new_position + 1; -- 2.26.2