Skip to content

redundant active/preview system counts #522

Closed

Description

@yakra

unsigned int active_systems = 0;
unsigned int preview_systems = 0;
// present stats by system here, also generate entries for
// DB table clinchedSystemMileageByRegion as we compute and
// have the data handy
for (HighwaySystem *h : HighwaySystem::syslist)
if (h->active_or_preview())
{ if (h->active()) active_systems++;
else preview_systems++;

active_systems = 0
preview_systems = 0
# present stats by system here, also generate entries for
# DB table clinchedSystemMileageByRegion as we compute and
# have the data handy
for h in highway_systems:
if h.active_or_preview():
if h.active():
active_systems += 1
else:
preview_systems += 1

These values don't need to be computed for every user log. Compute once, while

  • writing highwaydatastats.log, or
  • reading systems.csv <--probably this?
  • or like whatever

While in there, should also remove the comment, as csmbr_values is no longer a thing as of 9dcf0a5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions