Skip to content

Commit 0705e7b

Browse files
committed
detail (no need to write 'double' in source)
1 parent 4ccc457 commit 0705e7b

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

loslib.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
** $Id: loslib.c,v 1.54 2014/12/26 14:46:07 roberto Exp roberto $
2+
** $Id: loslib.c,v 1.55 2015/01/12 19:32:32 roberto Exp roberto $
33
** Standard Operating System library
44
** See Copyright Notice in lua.h
55
*/
@@ -297,8 +297,9 @@ static int os_time (lua_State *L) {
297297

298298

299299
static int os_difftime (lua_State *L) {
300-
double res = difftime((l_checktime(L, 1)), (l_checktime(L, 2)));
301-
lua_pushnumber(L, (lua_Number)res);
300+
time_t t1 = l_checktime(L, 1);
301+
time_t t2 = l_checktime(L, 2);
302+
lua_pushnumber(L, (lua_Number)difftime(t1, t2));
302303
return 1;
303304
}
304305

0 commit comments

Comments
 (0)