From fac3008e77310bb206ce85169f01426fd2124dd9 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Thu, 30 Sep 1999 11:19:16 +0000 Subject: 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. --- Mac/Python/macguesstabsize.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Mac/Python/macguesstabsize.c b/Mac/Python/macguesstabsize.c index 43af884..64a6ad7 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); -- cgit v0.12