mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Merge pull request #2088 from EngineerSmith/patch-1
Made love.data.newDataView size arg optional
This commit is contained in:
@@ -57,7 +57,7 @@ int w_newDataView(lua_State *L)
|
||||
Data *data = luax_checkdata(L, 1);
|
||||
|
||||
lua_Integer offset = luaL_checkinteger(L, 2);
|
||||
lua_Integer size = luaL_checkinteger(L, 3);
|
||||
lua_Integer size = luaL_optinteger(L, 3, data->getSize() - offset);
|
||||
|
||||
if (offset < 0 || size < 0)
|
||||
return luaL_error(L, "DataView offset and size must not be negative.");
|
||||
|
||||
Reference in New Issue
Block a user