Skip to content

Commit a8bd485

Browse files
committed
Replace const X f() with X f(). NFC.
Theoretically, this improves codegen by allowing `x = f()` to move-from the returned temporary instead of requiring a copy. In these cases I don't expect any effect; it's just to keep the codebase clean. Also change `operator"" _deg` to `operator""_deg`; the former spelling was deprecated in 2023 (but, strangely, was deprecated retroactively all the way back to C++11: see CWG2521).
1 parent 410b33e commit a8bd485

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

binary-tiling.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ EX namespace bt {
507507
}
508508
}
509509

510-
const transmatrix iadj(heptagon *h, int dir) { heptagon *h1 = h->cmove(dir); return adj(h1, h->c.spin(dir)); }
510+
transmatrix iadj(heptagon *h, int dir) { heptagon *h1 = h->cmove(dir); return adj(h1, h->c.spin(dir)); }
511511

512512
void virtualRebase(heptagon*& base, transmatrix& at) override {
513513

hyperpoint.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static constexpr ld degree = A_PI / 180;
2424
static const ld golden_phi = (sqrt(5)+1)/2;
2525
static const ld log_golden_phi = log(golden_phi);
2626

27-
constexpr ld operator"" _deg(long double deg) { return deg * A_PI / 180; }
27+
constexpr ld operator""_deg(long double deg) { return deg * A_PI / 180; }
2828
#endif
2929

3030
eGeometry geometry;

language.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
#include "hyper.h"
1111
namespace hr {
1212

13-
EX const string dnameof(eMonster m) { return m >= 0 && m < motypes ? minf[m].name : hr::format("[MONSTER %d]", m); }
14-
EX const string dnameof(eLand l) { return l >= 0 && l < landtypes ? linf[l].name : hr::format("[LAND %d]", l); }
15-
EX const string dnameof(eWall w) { return w >= 0 && w < walltypes ? winf[w].name : hr::format("[WALL %d]", w); }
16-
EX const string dnameof(eItem i) { return i >= 0 && i < ittypes ? iinf[i].name : hr::format("[ITEM %d]", i); }
13+
EX string dnameof(eMonster m) { return m >= 0 && m < motypes ? minf[m].name : hr::format("[MONSTER %d]", m); }
14+
EX string dnameof(eLand l) { return l >= 0 && l < landtypes ? linf[l].name : hr::format("[LAND %d]", l); }
15+
EX string dnameof(eWall w) { return w >= 0 && w < walltypes ? winf[w].name : hr::format("[WALL %d]", w); }
16+
EX string dnameof(eItem i) { return i >= 0 && i < ittypes ? iinf[i].name : hr::format("[ITEM %d]", i); }
1717

1818
#if HDR
1919
#define NUMLAN 9

0 commit comments

Comments
 (0)