Skip to content

Commit

Permalink
fixed: use multiplication instead of shift operator
Browse files Browse the repository at this point in the history
this implicitly casts to int in the process.
if not the shift makes little sense as everything is done
for an unsigned char
  • Loading branch information
akva2 committed Oct 7, 2021
1 parent 79d59cf commit 71afb42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SIM/SIMbase.C
Original file line number Diff line number Diff line change
Expand Up @@ -2270,7 +2270,7 @@ bool SIMbase::setPatchMaterial (size_t patch) const

bool SIMbase::addMADOF (unsigned char basis, unsigned char nndof, bool other)
{
int key = basis << 16 + nndof;
int key = basis*65536 + nndof;
if (extraMADOFs.find(key) != extraMADOFs.end())
return false; // This MADOF already calculated

Expand Down Expand Up @@ -2314,7 +2314,7 @@ bool SIMbase::addMADOF (unsigned char basis, unsigned char nndof, bool other)
const IntVec& SIMbase::getMADOF (unsigned char basis,
unsigned char nndof) const
{
int key = basis << 16 + nndof;
int key = basis*65536 + nndof;
auto it = extraMADOFs.find(key);
if (it != extraMADOFs.end())
return it->second;
Expand Down

0 comments on commit 71afb42

Please sign in to comment.