From 5f6191dfc12159211a6e0223a041c1fb246f42b6 Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Fri, 21 Apr 2017 18:16:08 +0300 Subject: [PATCH] Use SDL function for rwops size --- SDL2pp/RWops.cc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/SDL2pp/RWops.cc b/SDL2pp/RWops.cc index b691e37..e742794 100644 --- a/SDL2pp/RWops.cc +++ b/SDL2pp/RWops.cc @@ -191,12 +191,7 @@ Sint64 RWops::Tell() { } Sint64 RWops::Size() { - Sint64 old_pos = Tell(); - Sint64 size = Seek(0, RW_SEEK_END); - Sint64 back_pos = Seek(old_pos, RW_SEEK_SET); - (void)back_pos; // silence unused variable warning on release build - assert(back_pos == old_pos); - return size; + return SDL_RWsize(rwops_); } Uint16 RWops::ReadBE16() {