Skip to content

Conversation

@bobtista
Copy link

@bobtista bobtista commented Nov 29, 2025

Refactors aiDoCommand and AICommandParmsStorage::store to accept non-const pointers/references, enabling move semantics optimization.

Changes:

  • Changed aiDoCommand signature from const AICommandParms* to AICommandParms* across all implementations
  • Updated AICommandParmsStorage::store signature from const AICommandParms& to AICommandParms&

@bobtista bobtista force-pushed the bobtista/refactor-aidocommand-non-const branch from ba67dff to 2168e30 Compare November 30, 2025 15:33
@xezon
Copy link

xezon commented Nov 30, 2025

Modified store implementation to use move_or_swap for m_coords instead of copying

Where is that? I do not see.

@bobtista
Copy link
Author

Modified store implementation to use move_or_swap for m_coords instead of copying

Where is that? I do not see.

I removed it, I think it should be done in 1895 not here. I updated the description

@Mauller
Copy link

Mauller commented Dec 8, 2025

I think in this instance it's one of those times where i would say using const cast at the point where removing constness is required would be a better option.

Keeping the command considered const keeps that contract that we shouldn't be changing the data of the command and only consuming it.

i would then also put a comment on why we const cast that particular data.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants