Skip to content

Conversation

@adamdickmeiss
Copy link
Contributor

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request introduces a new utility function nmem_from_xml_buffer to simplify copying xmlBuffer data into NMEM-managed memory. The PR refactors existing code that was duplicating this pattern and reorganizes XML-related NMEM utilities into a dedicated source file.

Key changes:

  • Added new nmem_from_xml_buffer function that encapsulates the pattern of copying xmlBuffer contents to NMEM
  • Moved nmem_text_node_cdata function from nmemsdup.c to new nmem_xml.c file for better code organization
  • Refactored xml_match.c and solr.c to use the new utility function, reducing code duplication

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
win/makefile Added nmem_xml.obj to the build targets for Windows
src/yaz/nmem_xml.h Added declaration for new nmem_from_xml_buffer function
src/xml_match.c Refactored to use nmem_from_xml_buffer and added include for nmem_xml.h
src/solr.c Replaced direct xmlBuffer handling with nmem_from_xml_buffer call
src/nmemsdup.c Removed nmem_text_node_cdata function (moved to nmem_xml.c) and corrected include directive
src/nmem_xml.c New file containing XML-specific NMEM utilities including the new nmem_from_xml_buffer function
src/Makefile.am Added nmem_xml.c to source files, updated version info, and removed trailing whitespace

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@adamdickmeiss adamdickmeiss merged commit 1ccfe8a into master Jan 6, 2026
4 checks passed
@adamdickmeiss adamdickmeiss deleted the nmem-from-xml-buffer branch January 6, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants