mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-11 07:30:54 +00:00
libsysprof-capture: short-circuit empty write
This commit is contained in:
@ -203,6 +203,9 @@ sysprof_capture_writer_flush_data (SysprofCaptureWriter *self)
|
|||||||
g_assert (self->pos <= self->len);
|
g_assert (self->pos <= self->len);
|
||||||
g_assert ((self->pos % SYSPROF_CAPTURE_ALIGN) == 0);
|
g_assert ((self->pos % SYSPROF_CAPTURE_ALIGN) == 0);
|
||||||
|
|
||||||
|
if (self->pos == 0)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
buf = self->buf;
|
buf = self->buf;
|
||||||
to_write = self->pos;
|
to_write = self->pos;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user