mirror of https://github.com/odrling/Aegisub
Explicitly do nothing when an empty container is passed to delete_clear as it's oddly slow otherwise
Originally committed to SVN as r6402.
This commit is contained in:
parent
c2d3c910c7
commit
f774f21903
|
@ -74,9 +74,11 @@ namespace agi {
|
||||||
};
|
};
|
||||||
template<class T>
|
template<class T>
|
||||||
void delete_clear(T& container) {
|
void delete_clear(T& container) {
|
||||||
|
if (!container.empty()) {
|
||||||
std::for_each(container.begin(), container.end(), delete_ptr());
|
std::for_each(container.begin(), container.end(), delete_ptr());
|
||||||
container.clear();
|
container.clear();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace util
|
} // namespace util
|
||||||
} // namespace agi
|
} // namespace agi
|
||||||
|
|
Loading…
Reference in New Issue