From 3f8946c157eea14da864ac78ff6cf38cd7364b4e Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 3 Mar 2016 22:58:33 +0100 Subject: [PATCH] better naming of Record::Mutator content moving operation while the original name, 'replace', conveys the intention, this more standard name 'swap' reveals what is done and thus opens a wider array of possible usage --- src/lib/diff/record.hpp | 2 +- tests/library/diff/generic-record-representation-test.cpp | 2 +- tests/library/diff/generic-record-update-test.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/diff/record.hpp b/src/lib/diff/record.hpp index 764574aa6..14a3149b7 100644 --- a/src/lib/diff/record.hpp +++ b/src/lib/diff/record.hpp @@ -414,7 +414,7 @@ namespace diff{ } void - replace (Rec& existingInstance) noexcept + swap (Rec& existingInstance) noexcept { std::swap (existingInstance, record_); } diff --git a/tests/library/diff/generic-record-representation-test.cpp b/tests/library/diff/generic-record-representation-test.cpp index 0d4d516f2..82a7e6ddb 100644 --- a/tests/library/diff/generic-record-representation-test.cpp +++ b/tests/library/diff/generic-record-representation-test.cpp @@ -330,7 +330,7 @@ namespace test{ CHECK (mut != aa); - mut.replace(a); + mut.swap (a); CHECK (isnil (mut)); CHECK (Seq({"a = α", "b = β", "⟂", "a"}) == contents(a)); CHECK (Seq({"a = 1", "a"}) == contents(aa)); diff --git a/tests/library/diff/generic-record-update-test.cpp b/tests/library/diff/generic-record-update-test.cpp index ea61e6ee5..3c106e652 100644 --- a/tests/library/diff/generic-record-update-test.cpp +++ b/tests/library/diff/generic-record-update-test.cpp @@ -158,7 +158,7 @@ namespace test{ CHECK ( isnil (content)); CHECK (!isnil (mut)); - mut.replace(subject); + mut.swap (subject); CHECK (Seq({"a = α", "b = β", "γ", "δ", "ε"}) == contents(subject)); CHECK ("Rec(🌰| a = α, b = β |{γ, δ, ε})" == string(subject)); }