Commit fd3ceb09 authored by Dmitry Antipov's avatar Dmitry Antipov
Browse files

* nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):

Avoid redundant calls to strlen.
parent edfa7fa0
2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
* nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
Avoid redundant calls to strlen.
2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
 
Drop async_visible and async_iconified fields of struct frame.
......
......@@ -75,10 +75,9 @@ static void ns_glyph_metrics (struct nsfont_info *font_info,
static void
ns_escape_name (char *name)
{
int i =0, len =strlen (name);
for ( ; i<len; i++)
if (name[i] == ' ')
name[i] = '_';
for (; *name; name++)
if (*name == ' ')
*name = '_';
}
......@@ -86,10 +85,9 @@ static void ns_glyph_metrics (struct nsfont_info *font_info,
static void
ns_unescape_name (char *name)
{
int i =0, len =strlen (name);
for ( ; i<len; i++)
if (name[i] == '_')
name[i] = ' ';
for (; *name; name++)
if (*name == '_')
*name = ' ';
}
......@@ -364,7 +362,7 @@ seems to be limited for now (2009/05) to ja, zh, and ko. */
while CONSP (rts)
{
r = XCAR (XCAR (rts));
if (!strncmp(SSDATA(r), reg, strlen(SSDATA(r))))
if (!strncmp (SSDATA (r), reg, SBYTES (r)))
{
script = XCDR (XCAR (rts));
return [NSString stringWithUTF8String: SSDATA (SYMBOL_NAME (script))];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment