mirror of
				https://github.com/eledio-devices/thirdparty-tinyexpr.git
				synced 2025-10-31 16:14:16 +01:00 
			
		
		
		
	Optimized find_var
This commit is contained in:
		| @@ -117,7 +117,7 @@ static const double *find_var(const state *s, const char *name, int len) { | |||||||
|     int i; |     int i; | ||||||
|     if (!s->lookup) return 0; |     if (!s->lookup) return 0; | ||||||
|     for (i = 0; i < s->lookup_len; ++i) { |     for (i = 0; i < s->lookup_len; ++i) { | ||||||
|         if (strlen(s->lookup[i].name) == len && strncmp(name, s->lookup[i].name, len) == 0) { |         if (s->lookup[i].name[len] == '\0' && strncmp(name, s->lookup[i].name, len) == 0) { | ||||||
|             return s->lookup[i].value; |             return s->lookup[i].value; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user