Optimization: don't try to get a tabsize resource if we know the file

doesn't have one (stdin and such), OpenRF appears to be an expensive call.
This commit is contained in:
Jack Jansen 1999-09-30 11:19:16 +00:00
parent 4cc9562781
commit fac3008e77
1 changed files with 3 additions and 0 deletions

View File

@ -45,6 +45,9 @@ guesstabsize(path)
int refnum;
Handle h;
int tabsize = 0;
/* Very simple case: stdin (pathname empty) */
if ( path[0] == '\0' || strcmp(path, "<stdin>") == 0 ) return 0;
s[0] = strlen(path);
memcpy(s+1, path, s[0]);
refnum = OpenResFile(s);