diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2008-02-12 14:51:03 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2008-02-12 14:51:03 -0200 |
| commit | 7f69f0efb07d54bfb9d91ed426d2774a703be5ab (patch) | |
| tree | 42e38cab320a0d2a19510b5399c327ca2a65d7e8 | |
| parent | f6cab9666c90794596c0d1b3fa6ab86f94ab2f83 (diff) | |
| download | lua-7f69f0efb07d54bfb9d91ed426d2774a703be5ab.tar.gz lua-7f69f0efb07d54bfb9d91ed426d2774a703be5ab.tar.bz2 lua-7f69f0efb07d54bfb9d91ed426d2774a703be5ab.zip | |
remove of useless test in 'read_chars' (if n == 0 then the resulting
string cannot be empty).
| -rw-r--r-- | liolib.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: liolib.c,v 2.76 2007/04/19 20:22:32 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 2.77 2007/12/08 11:54:32 roberto Exp roberto $ |
| 3 | ** Standard I/O (and system) library | 3 | ** Standard I/O (and system) library |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -323,7 +323,7 @@ static int read_chars (lua_State *L, FILE *f, size_t n) { | |||
| 323 | n -= nr; /* still have to read `n' chars */ | 323 | n -= nr; /* still have to read `n' chars */ |
| 324 | } while (n > 0 && nr == rlen); /* until end of count or eof */ | 324 | } while (n > 0 && nr == rlen); /* until end of count or eof */ |
| 325 | luaL_pushresult(&b); /* close buffer */ | 325 | luaL_pushresult(&b); /* close buffer */ |
| 326 | return (n == 0 || lua_objlen(L, -1) > 0); | 326 | return (lua_objlen(L, -1) > 0); |
| 327 | } | 327 | } |
| 328 | 328 | ||
| 329 | 329 | ||
