Skip to content

Commit

Permalink
- Performance improvement for valueEq on strings
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7607 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jan 1, 2011
1 parent 26181b8 commit 1c39d06
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions c_runtime/meta_modelica.c
Expand Up @@ -115,8 +115,11 @@ valueEq_rettype valueEq(modelica_metatype lhs, modelica_metatype rhs)
d2 = mmc_prim_get_real(rhs);
return d1 == d2;
}
if (MMC_HDRISSTRING(h_lhs))
return 0 == strcmp(MMC_STRINGDATA(lhs),MMC_STRINGDATA(rhs));
if (MMC_HDRISSTRING(h_lhs)) {
if (MMC_HDRSTRLEN(h_lhs) == MMC_HDRSTRLEN(h_rhs))
return 0 == strcmp(MMC_STRINGDATA(lhs),MMC_STRINGDATA(rhs));
return 0;
}

numslots = MMC_HDRSLOTS(h_lhs);
ctor = 255 & (h_lhs >> 2);
Expand Down

0 comments on commit 1c39d06

Please sign in to comment.