We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Marker strings is set anew in every loop iteration unnecessarily.
void AI::CRC_Snapshot(Xfer *xfer) { xfer->xferSnapshot(m_pathfinder); Utf8String marker; for (TAiData *data = m_aiData; data != nullptr; data = data->m_next) { marker = "MARKER:TAiData"; xfer->xferAsciiString(&marker); xfer->xferSnapshot(data); } for (auto it = m_groupList.begin(); it != m_groupList.end(); it++) { if (*it != nullptr) { marker = "MARKER:AIGroup"; xfer->xferAsciiString(&marker); xfer->xferSnapshot(*it); } } }
Better:
void AI::CRC_Snapshot(Xfer *xfer) { xfer->xferSnapshot(m_pathfinder); Utf8String marker("MARKER:TAiData"); for (TAiData *data = m_aiData; data != nullptr; data = data->m_next) { xfer->xferAsciiString(&marker); xfer->xferSnapshot(data); } marker = "MARKER:AIGroup"; for (auto it = m_groupList.begin(); it != m_groupList.end(); it++) { if (*it != nullptr) { xfer->xferAsciiString(&marker); xfer->xferSnapshot(*it); } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Marker strings is set anew in every loop iteration unnecessarily.
Better:
The text was updated successfully, but these errors were encountered: