Skip to content

Commit 71afb42

Browse files
committed
fixed: use multiplication instead of shift operator
this implicitly casts to int in the process. if not the shift makes little sense as everything is done for an unsigned char
1 parent 79d59cf commit 71afb42

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/SIM/SIMbase.C

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2270,7 +2270,7 @@ bool SIMbase::setPatchMaterial (size_t patch) const
22702270

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

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

0 commit comments

Comments
 (0)