Skip to content

Commit

Permalink
Small optimisation on const
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcombriat committed Nov 14, 2023
1 parent 69388cd commit 48f827f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions FixMath2.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ class UFixMath2

// Constructor from another fixed type
template<byte _NI, byte _NF>
UFixMath2(UFixMath2<_NI,_NF> uf) {internal_value = SHIFTR((internal_type) uf.getInt(),(_NF-NF));}
UFixMath2(const UFixMath2<_NI,_NF>& uf) {internal_value = SHIFTR((internal_type) uf.getInt(),(_NF-NF));}

// Multiplication overload
template<byte _NI, byte _NF>
internal_type operator* (const UFixMath2<_NI,_NF> op)
internal_type operator* (const UFixMath2<_NI,_NF>& op)
{
byte sub = (NF+_NF)>>1;
Serial.println(sub);
Expand Down

0 comments on commit 48f827f

Please sign in to comment.