Revert "Another easy 15-20% by not searching with no references"

This reverts commit 3ae31fadc3.
This commit is contained in:
Crzyrndm 2018-07-30 07:22:45 +12:00
parent 544e90c975
commit c3296db932
2 changed files with 2 additions and 18 deletions

View File

@ -750,7 +750,8 @@ void cell::format(const class format new_format)
format().d_->references -= format().d_->references > 0 ? 1 : 0;
}
d_->format_ = detail::reference(new_format.d_);
++new_format.d_->references;
d_->format_ = new_format.d_;
}
calendar cell::base_date() const

View File

@ -419,7 +419,6 @@ struct stylesheet
if (pattern->references == 0)
{
*pattern = new_format;
return pattern;
}
return find_or_create(new_format);
}
@ -432,7 +431,6 @@ struct stylesheet
if (pattern->references == 0)
{
*pattern = new_format;
return pattern;
}
return find_or_create(new_format);
}
@ -445,7 +443,6 @@ struct stylesheet
if (pattern->references == 0)
{
*pattern = new_format;
return pattern;
}
return find_or_create(new_format);
}
@ -458,7 +455,6 @@ struct stylesheet
if (pattern->references == 0)
{
*pattern = new_format;
return pattern;
}
return find_or_create(new_format);
}
@ -471,7 +467,6 @@ struct stylesheet
if (pattern->references == 0)
{
*pattern = new_format;
return pattern;
}
return find_or_create(new_format);
}
@ -488,7 +483,6 @@ struct stylesheet
if (pattern->references == 0)
{
*pattern = new_format;
return pattern;
}
return find_or_create(new_format);
}
@ -501,7 +495,6 @@ struct stylesheet
if (pattern->references == 0)
{
*pattern = new_format;
return pattern;
}
return find_or_create(new_format);
}
@ -584,15 +577,5 @@ struct stylesheet
std::vector<color> colors;
};
inline format_impl* reference(format_impl *impl)
{
++impl->references;
if (impl->references == 1)
{
impl = impl->parent->find_or_create(*impl);
}
return impl;
}
} // namespace detail
} // namespace xlnt