SQL refactoring.
Posted: Wed Apr 30, 2008 7:59 am
While I was distracted, I refactored the SQL handling. I turned zm_db.cpp into a class, changed everything else to use that class, and changed all the field accesses to reference by name.
I also extracted all the common code out of the LoadMonitor functions.
The combined result of these changes is to make the code about 300 lines shorter.
Patch is versus 1.23.3
Ok, I had posted the patch here, but it was turned into junk by the forum software. Seriously, you must have a better way for people to submit patches than cutting and posting them into forums!?!?
Actual patch is at http://www.dgmo.org/diffs/zm-1.diff
I also extracted all the common code out of the LoadMonitor functions.
The combined result of these changes is to make the code about 300 lines shorter.
Patch is versus 1.23.3
Code: Select all
src/zm_config.cpp | 21 +--
src/zm_db.cpp | 175 +++++++++++--
src/zm_db.h | 56 ++++-
src/zm_event.cpp | 167 ++++--------
src/zm_monitor.cpp | 756 ++++++++++++---------------------------------------
src/zm_monitor.h | 2 +
src/zm_user.cpp | 78 ++----
src/zm_user.h | 2 +-
src/zm_zone.cpp | 88 +++----
src/zmfix.cpp | 50 +---
src/zmu.cpp | 25 +--
11 files changed, 535 insertions(+), 885 deletions(-)
Actual patch is at http://www.dgmo.org/diffs/zm-1.diff