// instead of strcmp() every item in the binary index
// we first compare the hashes
+ // FIXME
+ // we need the hash_name too!
+
uint32_t flags;
char cache_filename[FILENAME_MAX+1]; // the filename we load/save from/to this set
for(c = 0, d = r->st->dimensions; d ;c++, d = d->next)
r->od[c] |= RRDR_HIDDEN;
- while(o && *o && (tok = mystrsep(&o, ", |"))) {
+ while(o && *o && (tok = mystrsep(&o, ",|"))) {
if(!*tok) continue;
+
+ uint32_t hash = simple_hash(tok);
// find it and enable it
for(c = 0, d = r->st->dimensions; d ;c++, d = d->next) {
- if(!strcmp(d->name, tok)) {
+ if(unlikely((hash == d->hash && !strcmp(d->id, tok)) || !strcmp(d->name, tok))) {
r->od[c] &= ~RRDR_HIDDEN;
// since the user needs this dimension
if(!strcmp(name, "chart")) chart = value;
else if(!strcmp(name, "dimension") || !strcmp(name, "dim") || !strcmp(name, "dimensions") || !strcmp(name, "dims")) {
- if(!dimensions) dimensions = buffer_create(strlen(value));
+ if(!dimensions)
+ dimensions = buffer_create(strlen(value));
+
if(dimensions) {
buffer_strcat(dimensions, "|");
buffer_strcat(dimensions, value);
// render the badge
buffer_svg(w->response.data, label, n * multiply / divide, units, label_color, value_color, value_is_null, precision);
- return ret;
cleanup:
- if(dimensions) buffer_free(dimensions);
+ if(dimensions)
+ buffer_free(dimensions);
return ret;
}