Return immediately when using d_residual.
[debian/gnuradio] / gnuradio-core / src / lib / io / gr_udp_source.cc
index 1197a0c436c79e16423533a121304cfebd1210c5..da5b8a19159b7c6c312662297aad4a2e50b74b1d 100755 (executable)
@@ -243,7 +243,10 @@ gr_udp_source::work (int noutput_items,
     // Update indexing of amount of bytes left in the buffer
     d_residual -= nbytes;
     d_temp_offset += nbytes;
-    // FIXME? Returning here could simplify life...
+
+    // Return now with what we've got.
+    assert(nbytes % d_itemsize == 0);
+    return nbytes/d_itemsize;
   }
 
 #if USE_SELECT