Skip to content

Commit

Permalink
Rename lstRemove() to lstRemoveIdx().
Browse files Browse the repository at this point in the history
This works better with the names of upcoming functions and seems sensible even in isolation.
  • Loading branch information
dwsteele committed Sep 6, 2019
1 parent dde0c2b commit 2eb1d1f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/common/type/list.c
Expand Up @@ -171,7 +171,7 @@ lstInsert(List *this, unsigned int listIdx, const void *item)
Remove an item from the list
***********************************************************************************************************************************/
List *
lstRemove(List *this, unsigned int listIdx)
lstRemoveIdx(List *this, unsigned int listIdx)
{
FUNCTION_TEST_BEGIN();
FUNCTION_TEST_PARAM(LIST, this);
Expand Down
2 changes: 1 addition & 1 deletion src/common/type/list.h
Expand Up @@ -28,7 +28,7 @@ List *lstAdd(List *this, const void *item);
List *lstClear(List *this);
void *lstGet(const List *this, unsigned int listIdx);
List *lstInsert(List *this, unsigned int listIdx, const void *item);
List *lstRemove(List *this, unsigned int listIdx);
List *lstRemoveIdx(List *this, unsigned int listIdx);
MemContext *lstMemContext(const List *this);
List *lstMove(List *this, MemContext *parentNew);
unsigned int lstSize(const List *this);
Expand Down
2 changes: 1 addition & 1 deletion src/info/infoBackup.c
Expand Up @@ -371,7 +371,7 @@ infoBackupDataDelete(const InfoBackup *this, const String *backupDeleteLabel)
InfoBackupData backupData = infoBackupData(this, idx);

if (strCmp(backupData.backupLabel, backupDeleteLabel) == 0)
lstRemove(this->backup, idx);
lstRemoveIdx(this->backup, idx);
}

FUNCTION_LOG_RETURN_VOID();
Expand Down
2 changes: 1 addition & 1 deletion src/protocol/parallel.c
Expand Up @@ -253,7 +253,7 @@ protocolParallelResult(ProtocolParallel *this)
if (protocolParallelJobState(job) == protocolParallelJobStateDone)
{
result = protocolParallelJobMove(job, memContextCurrent());
lstRemove(this->jobList, jobIdx);
lstRemoveIdx(this->jobList, jobIdx);
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/src/module/common/typeListTest.c
Expand Up @@ -83,7 +83,7 @@ testRun(void)
}

// Remove first item
TEST_RESULT_VOID(lstRemove(list, 0), "remove first item");
TEST_RESULT_VOID(lstRemoveIdx(list, 0), "remove first item");

// Read them back and check values
for (unsigned int listIdx = 0; listIdx < lstSize(list); listIdx++)
Expand All @@ -93,7 +93,7 @@ testRun(void)
}

// Remove last item
TEST_RESULT_VOID(lstRemove(list, lstSize(list) - 1), "remove last item");
TEST_RESULT_VOID(lstRemoveIdx(list, lstSize(list) - 1), "remove last item");

// Read them back and check values
for (unsigned int listIdx = 0; listIdx < lstSize(list); listIdx++)
Expand Down

0 comments on commit 2eb1d1f

Please sign in to comment.