Add const values 'nRows' and 'nCols'
ClosedPublic

Authored by yanjiehe on Feb 2 2020, 5:29 PM.

Details

Summary

Replace the previous usages of integer 8 with 'nRows' and 'nCols'.

Diff Detail

Repository
R411 KReversi
Lint
Lint Skipped
Unit
Unit Tests Skipped
yanjiehe created this revision.Feb 2 2020, 5:29 PM
Restricted Application added a reviewer: KDE Games. · View Herald TranscriptFeb 2 2020, 5:29 PM
Restricted Application added a subscriber: kde-games-devel. · View Herald Transcript
yanjiehe requested review of this revision.Feb 2 2020, 5:29 PM
chehrlic added inline comments.
commondefs.h
45

static const -> constexpr

yanjiehe added inline comments.Feb 2 2020, 5:49 PM
commondefs.h
45

Thank you for your comment! But I doubt that change static const -> constexpr will have any improvement in performance or readability. Basic they are doing the same thing in this situation. I would still prefer using 'static const' because the code does not involve any computation in compile time.

yanjiehe marked an inline comment as done.Feb 2 2020, 5:51 PM
yanjiehe added inline comments.
commondefs.h
45

Thank you for your comment! But I doubt that change static const -> constexpr will have any improvement in performance or readability. Basically they are doing the same thing in this situation. I would still prefer using 'static const' because the code does not involve any computation in compile time.

aacid accepted this revision.Feb 6 2020, 7:24 PM
aacid added a subscriber: aacid.

Agreed with @yanjiehe no really win in using constexpr there, i'll land this as it is. @chehrlic if you want to make it perfect later, go for it :)

This revision is now accepted and ready to land.Feb 6 2020, 7:24 PM
aacid closed this revision.Feb 6 2020, 7:24 PM