[fc-solve] recycle instances instead of freeing.
AcceptedPublic

Authored by shlomif on Apr 10 2020, 6:56 PM.

Details

Reviewers
aacid
Group Reviewers
KDE Games
Summary

This is better for preventing memory fragmentation and may also be a
little faster. Some methods were extracted, library calls avoided,
and the code cleaned up.

I hereby disclaim any implicit or explicit ownership of my changes in this
changeset, and put them under a multiple licence consisting of your choice of
one of more of:

  • Any licence in the 2018-Aug-27 popular licenses list of

https://opensource.org/licenses

Crediting me will be nice, but not mandatory, and you can change the licence
of the project without needing my permission.

Test Plan

build and run the test suite and check that the tests pass and then try playing freecell or Simple Simon.

Diff Detail

Repository
R410 KPatience
Branch
fc-solve-refactoring-and-optimize
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 25030
Build 25048: arc lint + arc unit
shlomif created this revision.Apr 10 2020, 6:56 PM
Restricted Application added a reviewer: KDE Games. · View Herald TranscriptApr 10 2020, 6:56 PM
Restricted Application added a subscriber: kde-games-devel. · View Herald Transcript
shlomif requested review of this revision.Apr 10 2020, 6:56 PM
aacid added a subscriber: aacid.Apr 12 2020, 2:44 PM
aacid added inline comments.
patsolve/abstract_fc_solve_solver.cpp
182

Why we don't need to call this anymore?

@aacid : hi! The get_next_move() function already returns non-zero when there are no more moves left, so we can rely on checking its return value.

aacid accepted this revision.May 3 2020, 1:26 PM

Ok, if you're sure it's worth it

This revision is now accepted and ready to land.May 3 2020, 1:26 PM