Skip to content

redundant active/preview system counts #522

Description

@yakra

unsignedint active_systems = 0;
unsignedint 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
forhinhighway_systems:
ifh.active_or_preview():
ifh.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.

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