Compare commits

..

1 Commits

Author SHA1 Message Date
Onyad
aa8d4e4750 up 2025-09-04 14:42:16 -05:00
4 changed files with 13 additions and 4 deletions

View File

@@ -50,7 +50,7 @@ jobs:
packages: googletest libgmock-dev libgtest-dev
version: 1.0
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Configure
run: |
@@ -108,7 +108,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Build
run: |
@@ -126,7 +126,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Build
shell: bash

View File

@@ -12,7 +12,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4.1.1
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: git archive $GITHUB_REF -o "yaml-cpp-${GITHUB_REF:10}.tar.gz"
- run: gh release upload ${GITHUB_REF:10} "yaml-cpp-${GITHUB_REF:10}.tar.gz"
env:

View File

@@ -25,6 +25,7 @@ class YAML_CPP_API memory {
memory() : m_nodes{} {}
node& create_node();
void merge(const memory& rhs);
size_t size() const;
private:
using Nodes = std::set<shared_node>;

View File

@@ -9,6 +9,10 @@ void memory_holder::merge(memory_holder& rhs) {
if (m_pMemory == rhs.m_pMemory)
return;
if (m_pMemory->size() < rhs.m_pMemory->size()) {
std::swap(m_pMemory, rhs.m_pMemory);
}
m_pMemory->merge(*rhs.m_pMemory);
rhs.m_pMemory = m_pMemory;
}
@@ -22,5 +26,9 @@ node& memory::create_node() {
void memory::merge(const memory& rhs) {
m_nodes.insert(rhs.m_nodes.begin(), rhs.m_nodes.end());
}
size_t memory::size() const {
return m_nodes.size();
}
} // namespace detail
} // namespace YAML