Remove redundant check for NULL in MeshStreamer
authorLukasz Wesolowski <wesolwsk@illinois.edu>
Wed, 26 Oct 2011 20:41:38 +0000 (15:41 -0500)
committerLukasz Wesolowski <wesolwsk@illinois.edu>
Wed, 26 Oct 2011 20:42:32 +0000 (15:42 -0500)
src/libs/ck-libs/MeshStreamer/MeshStreamer.h

index 9f3cc9c4bf0a8f27ce6d8c7e3bce22ae0fc88f45..291903a4014694cf8ddff96026deaba5859dd3db 100644 (file)
@@ -417,14 +417,14 @@ void MeshStreamer<dtype>::flushLargestBucket(MeshStreamerMessage<dtype> **messag
   if (maxSize > 0) {
     destinationBucket = messageBuffers[flushIndex];
     destinationIndex = myNodeIndex_ + (flushIndex - myIndex) * dimensionFactor;
-    if (destinationBucket != NULL) {
-      if (destinationBucket->capacity > destinationBucket->numDataItems) {
-          // not sending the full buffer, shrink the message size
-        envelope *env = UsrToEnv(destinationBucket);
-        env->setTotalsize(env->getTotalsize() - (destinationBucket->capacity - destinationBucket->numDataItems) * sizeof(dtype));
-      }
-      numDataItemsBuffered_ -= destinationBucket->numDataItems;
+
+    if (destinationBucket->capacity > destinationBucket->numDataItems) {
+      // not sending the full buffer, shrink the message size
+      envelope *env = UsrToEnv(destinationBucket);
+      env->setTotalsize(env->getTotalsize() - (destinationBucket->capacity - destinationBucket->numDataItems) * sizeof(dtype));
     }
+    numDataItemsBuffered_ -= destinationBucket->numDataItems;
+
     if (messageBuffers == personalizedBuffers_) {
       clientProxy_[destinationIndex].receiveCombinedData(destinationBucket);
     }