This is an automated email from the git hooks/post-receive script.
git pushed a commit to reference refs/pull/114/head
in repository efl.
View the commit online.
commit a391a8d96e56bc8e0de6786727fca05babe4aaba
Author: [email protected] <[email protected]>
AuthorDate: Sun Sep 13 18:01:51 2026 -0600
evas: return early from _generic_cache_budget once it is known
The review suggested flattening this function. Check the cached budget
first and return straight away, then read EVAS_SURFACE_CACHE_SIZE only
when the budget is not set yet. This removes a level of nesting.
Behaviour is unchanged: the environment variable is read once and the
cached value is returned after that. The function is only called when a
cache is created, so this is about readability, not speed.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
---
src/lib/evas/common/evas_common_generic_cache.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/lib/evas/common/evas_common_generic_cache.c b/src/lib/evas/common/evas_common_generic_cache.c
index eef31fe62b..428b9eba2c 100644
--- a/src/lib/evas/common/evas_common_generic_cache.c
+++ b/src/lib/evas/common/evas_common_generic_cache.c
@@ -12,14 +12,14 @@ static size_t
_generic_cache_budget(void)
{
static size_t v = 0;
+ const char *e;
+ long kb;
- if (!v)
- {
- const char *e = getenv("EVAS_SURFACE_CACHE_SIZE");
- long kb = e ? atol(e) : 0;
+ if (v) return v;
- v = (kb > 0) ? ((size_t)kb * 1024) : GENERIC_CACHE_DEFAULT_BUDGET;
- }
+ e = getenv("EVAS_SURFACE_CACHE_SIZE");
+ kb = e ? atol(e) : 0;
+ v = (kb > 0) ? ((size_t)kb * 1024) : GENERIC_CACHE_DEFAULT_BUDGET;
return v;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.