summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2015-03-03 00:06:40 -0800
committerPatrick Ohly <patrick.ohly@intel.com>2015-03-03 00:06:40 -0800
commitecb7a08914eb07d3889196f6e40345305c175b84 (patch)
tree90af83d4e6053230c7aaef0fd7992ba8fa890842
parent4e9384f5c6bc3da80435ba15301f9b6e2db9bf0c (diff)
TCustomImplDS::getItemFromSyncSetItem: remove redundant NULL checklibsynthesis_3.4.0.47+syncevolution-1-5-1
Despite what the comment for the method said, the parameter was dereferenced unconditionally and thus was not allowed to be NULL. Fixing the comment and removing the redundant NULL check. Found with clang.
-rwxr-xr-xsrc/sysync/customimplds.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/sysync/customimplds.cpp b/src/sysync/customimplds.cpp
index 695e8b9..c8540d6 100755
--- a/src/sysync/customimplds.cpp
+++ b/src/sysync/customimplds.cpp
@@ -3409,11 +3409,10 @@ localstatus TCustomImplDS::zapSyncSetOneByOne(void)
// private helper: get item with data from sync set list. Retrieves item if not already
// there from loading the sync set
-// Note: can be called with aSyncSetItemP==NULL, which causes directly loading from DB
-// in all cases.
+// Note: cannot be called with aSyncSetItemP==NULL; only aSyncSetItemP->itemP may be NULL
localstatus TCustomImplDS::getItemFromSyncSetItem(TSyncSetItem *aSyncSetItemP, TSyncItem *&aItemP)
{
- if (aSyncSetItemP && aSyncSetItemP->itemP) {
+ if (aSyncSetItemP->itemP) {
// already fetched - pass it to caller and remove link in syncsetitem
aItemP = aSyncSetItemP->itemP;
aSyncSetItemP->itemP = NULL; // syncsetitem does not own it any longer