mirror of
https://github.com/love2d/love.git
synced 2026-08-15 07:41:11 +02:00
Use a seekless implementation of File:lines/love.filesystem.lines
The previous algorithm would seek every time. This meant that although reading from a filesystem would be quick (especially with disk caching), but reading from a zip would be extremely slow. The new version is rouhgly as fast on a filesystem, but appears not to slow down on zips at all. Not in my tests, at least. --HG-- branch : minor
This commit is contained in:
@@ -531,7 +531,9 @@ int w_lines(lua_State *L)
|
||||
else
|
||||
return luaL_argerror(L, 1, "expected filename.");
|
||||
|
||||
lua_pushcclosure(L, w_File_lines_i, 1);
|
||||
lua_pushstring(L, ""); // buffer
|
||||
lua_pushstring(L, 0); // buffer offset
|
||||
lua_pushcclosure(L, w_File_lines_i, 3);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user