Run pgindent on generic_xlog.c.

This code desperately needs some micro-optimization, and I'd like it
to be formatted a bit more nicely while I work on it.
This commit is contained in:
Tom Lane 2016-04-09 13:33:33 -04:00
parent 381200be4b
commit 2dd318d277
1 changed files with 39 additions and 36 deletions

View File

@ -171,14 +171,15 @@ writeDelta(PageData *pageData)
BLCKSZ - fragmentBegin, BLCKSZ - fragmentBegin,
page + fragmentBegin); page + fragmentBegin);
#ifdef WAL_DEBUG
/* /*
* If xlog debug is enabled, then check produced delta. Result of delta * If xlog debug is enabled, then check produced delta. Result of delta
* application to saved image should be the same as current page state. * application to saved image should be the same as current page state.
*/ */
#ifdef WAL_DEBUG
if (XLOG_DEBUG) if (XLOG_DEBUG)
{ {
char tmp[BLCKSZ]; char tmp[BLCKSZ];
memcpy(tmp, image, BLCKSZ); memcpy(tmp, image, BLCKSZ);
applyPageRedo(tmp, pageData->data, pageData->dataLen); applyPageRedo(tmp, pageData->data, pageData->dataLen);
if (memcmp(tmp, page, pageLower) if (memcmp(tmp, page, pageLower)
@ -218,6 +219,7 @@ GenericXLogRegister(GenericXLogState *state, Buffer buffer, bool isNew)
for (block_id = 0; block_id < MAX_GENERIC_XLOG_PAGES; block_id++) for (block_id = 0; block_id < MAX_GENERIC_XLOG_PAGES; block_id++)
{ {
PageData *page = &state->pages[block_id]; PageData *page = &state->pages[block_id];
if (BufferIsInvalid(page->buffer)) if (BufferIsInvalid(page->buffer))
{ {
page->buffer = buffer; page->buffer = buffer;
@ -372,7 +374,8 @@ GenericXLogAbort(GenericXLogState *state)
static void static void
applyPageRedo(Page page, Pointer data, Size dataSize) applyPageRedo(Page page, Pointer data, Size dataSize)
{ {
Pointer ptr = data, end = data + dataSize; Pointer ptr = data,
end = data + dataSize;
while (ptr < end) while (ptr < end)
{ {