From: Jack Jansen Date: Thu, 30 Sep 1999 11:19:16 +0000 (+0000) Subject: Optimization: don't try to get a tabsize resource if we know the file X-Git-Tag: v1.6a1~857 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fac3008e77310bb206ce85169f01426fd2124dd9;p=python 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. --- diff --git a/Mac/Python/macguesstabsize.c b/Mac/Python/macguesstabsize.c index 43af8845fd..64a6ad7c6e 100644 --- a/Mac/Python/macguesstabsize.c +++ b/Mac/Python/macguesstabsize.c @@ -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, "") == 0 ) return 0; s[0] = strlen(path); memcpy(s+1, path, s[0]); refnum = OpenResFile(s);