mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-21 10:03:27 +00:00
fix config::get_diff
This commit is contained in:
parent
fd9bfbc42d
commit
622d4c1313
@ -1063,8 +1063,9 @@ void config::get_diff(const config& c, config& res) const
|
||||
|
||||
attribute_map::const_iterator i;
|
||||
for(i = values.begin(); i != values.end(); ++i) {
|
||||
if(i->second.blank()) continue;
|
||||
const attribute_map::const_iterator j = c.values.find(i->first);
|
||||
if(j == c.values.end() || (i->second != j->second && i->second != "")) {
|
||||
if(j == c.values.end() || (i->second != j->second && !i->second.blank() )) {
|
||||
if(inserts == NULL) {
|
||||
inserts = &res.add_child("insert");
|
||||
}
|
||||
@ -1076,8 +1077,9 @@ void config::get_diff(const config& c, config& res) const
|
||||
config* deletes = NULL;
|
||||
|
||||
for(i = c.values.begin(); i != c.values.end(); ++i) {
|
||||
if(i->second.blank()) continue;
|
||||
const attribute_map::const_iterator itor = values.find(i->first);
|
||||
if(itor == values.end() || itor->second == "") {
|
||||
if(itor == values.end() || itor->second.blank()) {
|
||||
if(deletes == NULL) {
|
||||
deletes = &res.add_child("delete");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user