libsysprof-capture: short-circuit empty write

This commit is contained in:
Christian Hergert
2019-06-05 15:10:48 -07:00
parent 766c27ae90
commit 26c029b7a2

View File

@ -203,6 +203,9 @@ sysprof_capture_writer_flush_data (SysprofCaptureWriter *self)
g_assert (self->pos <= self->len);
g_assert ((self->pos % SYSPROF_CAPTURE_ALIGN) == 0);
if (self->pos == 0)
return TRUE;
buf = self->buf;
to_write = self->pos;