From 9a3685348d1205cbffeb784df296d55216f512aa Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sat, 1 Mar 2014 12:09:41 -0500 Subject: Use `assert(...)` as a shortcut for `if not ... then error() end`. --- core/locale.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/locale.lua') diff --git a/core/locale.lua b/core/locale.lua index fb3f0742..51ff68a6 100644 --- a/core/locale.lua +++ b/core/locale.lua @@ -15,7 +15,7 @@ if not f then if lang then f = io.open(_HOME..'/core/locales/locale.'..lang..'.conf') end end if not f then f = io.open(_HOME..'/core/locale.conf', 'rb') end -if not f then error('"core/locale.conf" not found.') end +assert(f, '"core/locale.conf" not found.') for line in f:lines() do if not line:find('^%s*%%') then local id, str = line:match('^(.-)%s*=%s*(.+)$') -- cgit v1.2.3