Hot answers tagged

2

General Observations This code should work just fine, but performance can be enhanced. Initialize Arrays to Zero at Compile Time Currently there is a performance hit in the code when initializing the array t to zero. The function memset() is a runtime function, by initializing the array t to zero there is no run time cost: char t[32767] = {0}; The ...


1

Use std::collections::HashMap Your variables and functions are stored in a Vec<ConVar> or Vec<ConCommand>, instead use a HashMap<String, String> and HashMap<String, fn(&[String]>. Then you can readily use the get, insert, and entry apis to simplify your code. Your parse function duplicates a lot of functionality that already ...


Only top voted, non community-wiki answers of a minimum length are eligible