WL#2394: Code optimization when no UCS2
Affects: Server-7.1
—
Status: Assigned
When no UCS2 is incompiled into the server, it is possible
to optimize the code to make it a bit faster.
Particulary, these comparisions should be be removed:
if (cs->mbminlen > 1) { ... }
Serg suggested a nice idea how to do it:
Not to add lots of ifdefs around these comparisons,
we can create this macros:
#ifdef HAVE_UCS2
#define have_ucs(X) (X)
#else
#define have_ucs(X) (0)
#endif
Then we can use this instead of the above comparisons:
if (have_ucs(cs->mbminlen > 1)) { ... }
Smart compilers like gcc can optimize this structure by
removing dead code.
Copyright (c) 2000, 2025, Oracle Corporation and/or its affiliates. All rights reserved.