summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2022-11-22 19:04:13 +0100
committerEike Rathke <erack@redhat.com>2022-11-22 20:13:01 +0100
commit8cc4e6c8f572d84dc004d97fa25d17fe85505dc6 (patch)
treed5cd60d8084066ced4b2af5495161b64e71caa9d /tools
parent00ee70be17c1c466674552b59737e39fb785e907 (diff)
Calculate null-date days to assert only once
Massively called it is really unnecessary to do that each and every time. The debug build is slow enough.. Change-Id: I06525e4ca1fa23a1d49dd735370eb157157800e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143127 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'tools')
-rw-r--r--tools/source/datetime/tdate.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/source/datetime/tdate.cxx b/tools/source/datetime/tdate.cxx
index 4b135fc3008a..e20add430353 100644
--- a/tools/source/datetime/tdate.cxx
+++ b/tools/source/datetime/tdate.cxx
@@ -72,7 +72,10 @@ sal_Int32 Date::GetAsNormalizedDays() const
// This is a very common datum we often calculate from.
if (mnDate == 18991230) // 1899-12-30
{
- assert(DateToDays( GetDay(), GetMonth(), GetYear() ) == 693594);
+#ifndef NDEBUG
+ static sal_Int32 nDays = DateToDays( GetDay(), GetMonth(), GetYear());
+ assert(nDays == 693594);
+#endif
return 693594;
}
// Not calling comphelper::date::convertDateToDaysNormalizing() here just