1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Use cstring_to_text_with_len when length is known.

This avoids a potentially-expensive extra call to strlen().

David Rowley
This commit is contained in:
Robert Haas
2013-11-18 10:17:07 -05:00
parent 4c697d8f48
commit f1df4731ee
2 changed files with 7 additions and 7 deletions

View File

@ -56,5 +56,5 @@ fsm_page_contents(PG_FUNCTION_ARGS)
}
appendStringInfo(&sinfo, "fp_next_slot: %d\n", fsmpage->fp_next_slot);
PG_RETURN_TEXT_P(cstring_to_text(sinfo.data));
PG_RETURN_TEXT_P(cstring_to_text_with_len(sinfo.data, sinfo.len));
}