diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1999-09-30 11:19:16 +0000 |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1999-09-30 11:19:16 +0000 |
commit | 85cf9af38667aa1a860d3272da8423b8da1a158c (patch) | |
tree | 151f424ce00b67f13aff732cf805617ede9f5167 /Mac/Python | |
parent | 0760cb5aa8a69d737785ed6c80b5823b0f2de779 (diff) | |
download | cpython-85cf9af38667aa1a860d3272da8423b8da1a158c.tar.gz |
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.
Diffstat (limited to 'Mac/Python')
-rw-r--r-- | Mac/Python/macguesstabsize.c | 3 |
1 files changed, 3 insertions, 0 deletions
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, "<stdin>") == 0 ) return 0; s[0] = strlen(path); memcpy(s+1, path, s[0]); refnum = OpenResFile(s); |