mirror of
				https://github.com/LDDestroier/CC/
				synced 2025-10-31 07:22:59 +00:00 
			
		
		
		
	reorder if statements (#11)
Lua supports short-circuit evaluation, we can use it to speed up execution in some cases.
This commit is contained in:
		| @@ -9,10 +9,10 @@ local function netrequire(_name, alwaysDownload, ...) | |||||||
| 		name = _name | 		name = _name | ||||||
| 	end | 	end | ||||||
| 	 | 	 | ||||||
| 	if fs.exists(fs.combine(DL_path .. "/require", name)) and not alwaysDownload then | 	if (not alwaysDownload) and fs.exists(fs.combine(DL_path .. "/require", name)) then | ||||||
| 		return loadfile(fs.combine(DL_path .. "/require", name))(...) | 		return loadfile(fs.combine(DL_path .. "/require", name))(...) | ||||||
| 		 | 		 | ||||||
| 	elseif fs.exists(fs.combine(DL_path .. "/loadAPI", name)) and not alwaysDownload then | 	elseif (not alwaysDownload) and fs.exists(fs.combine(DL_path .. "/loadAPI", name)) then | ||||||
| 		os.loadAPI(fs.combine(DL_path .. "/loadAPI", name)) | 		os.loadAPI(fs.combine(DL_path .. "/loadAPI", name)) | ||||||
| 		return _ENV[fs.getName(name)] | 		return _ENV[fs.getName(name)] | ||||||
| 		 | 		 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Lupus590
					Lupus590