Browse Source

Optimisation: Cache date suffix into $stat_day_suffix in stat_display to reduce execution calls.

Hooded Silence 6 months ago
parent
commit
f7e20fe945
2 changed files with 5 additions and 3 deletions
  1. 3 0
      locations/cikl.qsrc
  2. 2 3
      locations/stat_display.qsrc

+ 3 - 0
locations/cikl.qsrc

@@ -24,6 +24,9 @@ end
 day += 1
 week += 1
 hour -= 24
+gs 'emp_functions', 'evt_day_suffix'
+$stat_day_suffix = $date_suffix
+killvar '$date_suffix'
 
 if day > monthsEnd[month]:
 	day -= monthsEnd[month]

+ 2 - 3
locations/stat_display.qsrc

@@ -94,14 +94,13 @@ $stat_disable_msg = 'Menu is disabled for this event.'
 
 !$stat_msg += '<<$weather>><BR>'
 !pl '<<$weatherImage>>'
-gs 'emp_functions', 'evt_day_suffix'
-if timeHidden = 0: $stat_msg += '<BR><<$stat_android>> <<$week[week]>> <<day>><<$date_suffix>> <<$month>> <<year>>'
+!! $stat_day_suffix is generated at midnight in cikl
+if timeHidden = 0: $stat_msg += '<BR><<$stat_android>> <<$week[week]>> <<day>><<$stat_day_suffix>> <<$month>> <<year>>'
 $stat_android += '<<$week[week]>> <<day>>/<<month>>, <<money>> ₽, <a href="exec:clr & pl $stat_android">Status</a>'
 ! $stat_android for short desc in android mode, $stat_msg for status bar.
 if mid($start_type,1,2) = 'sg' and SchoolAtestat ! 1 and $holyday ! '': $stat_msg += '<BR><<$holyday>>' & $stat_msg += '<BR>'
 if birthday = day and birthmonth = month: $stat_msg += '<BR><b>Today is your birthday.</b>' & $stat_msg += '<BR>'
 if telefon['UnreadSMS'] > 0: $stat_msg += '<BR><b>You have <<telefon[''UnreadSMS'']>> unread message(s).</b><BR>'
-killvar '$evt_suffix'
 
 !New icon based menu.
 if $start_type[1] ! 'nomagic':