summaryrefslogtreecommitdiffstats
path: root/core/os/time.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-02-15 15:44:43 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-02-15 15:44:43 +0100
commitef5d6ccfb7bf155a238ada79db12ea41ca993116 (patch)
treebc1acc6c5b0df70661293de0f8d0586ce0808982 /core/os/time.cpp
parent4859f8090f1e21d42bc81313f15367dcb1c4220c (diff)
parenta8bc9f3e78788bdf0be7348fcbfac15c127f1f48 (diff)
downloadredot-engine-ef5d6ccfb7bf155a238ada79db12ea41ca993116.tar.gz
Merge pull request #86966 from Muller-Castro/value2ref-core
Add const lvalue ref to `core/*` container parameters
Diffstat (limited to 'core/os/time.cpp')
-rw-r--r--core/os/time.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/os/time.cpp b/core/os/time.cpp
index 7068935d36..d1d3588d09 100644
--- a/core/os/time.cpp
+++ b/core/os/time.cpp
@@ -255,7 +255,7 @@ String Time::get_time_string_from_unix_time(int64_t p_unix_time_val) const {
return vformat("%02d:%02d:%02d", hour, minute, second);
}
-Dictionary Time::get_datetime_dict_from_datetime_string(String p_datetime, bool p_weekday) const {
+Dictionary Time::get_datetime_dict_from_datetime_string(const String &p_datetime, bool p_weekday) const {
PARSE_ISO8601_STRING(Dictionary())
Dictionary dict;
dict[YEAR_KEY] = year;
@@ -273,7 +273,7 @@ Dictionary Time::get_datetime_dict_from_datetime_string(String p_datetime, bool
return dict;
}
-String Time::get_datetime_string_from_datetime_dict(const Dictionary p_datetime, bool p_use_space) const {
+String Time::get_datetime_string_from_datetime_dict(const Dictionary &p_datetime, bool p_use_space) const {
ERR_FAIL_COND_V_MSG(p_datetime.is_empty(), "", "Invalid datetime Dictionary: Dictionary is empty.");
EXTRACT_FROM_DICTIONARY
VALIDATE_YMDHMS("")
@@ -287,7 +287,7 @@ String Time::get_datetime_string_from_datetime_dict(const Dictionary p_datetime,
return timestamp;
}
-int64_t Time::get_unix_time_from_datetime_dict(const Dictionary p_datetime) const {
+int64_t Time::get_unix_time_from_datetime_dict(const Dictionary &p_datetime) const {
ERR_FAIL_COND_V_MSG(p_datetime.is_empty(), 0, "Invalid datetime Dictionary: Dictionary is empty");
EXTRACT_FROM_DICTIONARY
VALIDATE_YMDHMS(0)
@@ -295,7 +295,7 @@ int64_t Time::get_unix_time_from_datetime_dict(const Dictionary p_datetime) cons
return day_number * SECONDS_PER_DAY + hour * 3600 + minute * 60 + second;
}
-int64_t Time::get_unix_time_from_datetime_string(String p_datetime) const {
+int64_t Time::get_unix_time_from_datetime_string(const String &p_datetime) const {
PARSE_ISO8601_STRING(-1)
VALIDATE_YMDHMS(0)
YMD_TO_DAY_NUMBER