Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rémi Cailletaud
yade
Commits
154d03a2
Commit
154d03a2
authored
Jun 10, 2016
by
Anton Gladky
Browse files
Reduce size of flags in Bounds of InsertionSortCollider
Replace unsigned by bool. Size changed from 4 to 1 byte.
parent
0a59da52
Changes
1
Show whitespace changes
Inline
Side-by-side
pkg/common/InsertionSortCollider.hpp
View file @
154d03a2
...
...
@@ -78,9 +78,7 @@ class Integrator;
class
GeneralIntegratorInsertionSortCollider
;
// Forward decleration of child to decleare it as friend
class
InsertionSortCollider
:
public
Collider
{
friend
class
GeneralIntegratorInsertionSortCollider
;
//! struct for storing bounds of bodies
struct
Bounds
{
//! coordinate along the given sortAxis
...
...
@@ -90,7 +88,7 @@ class InsertionSortCollider: public Collider{
//! periodic cell coordinate
int
period
;
//! is it the minimum (true) or maximum (false) bound?
struct
{
unsigned
hasBB
:
1
;
unsigned
isMin
:
1
;
}
flags
;
struct
{
bool
hasBB
:
true
,
isMin
:
true
;
}
flags
;
Bounds
(
Real
coord_
,
Body
::
id_t
id_
,
bool
isMin
)
:
coord
(
coord_
),
id
(
id_
),
period
(
0
){
flags
.
isMin
=
isMin
;
}
bool
operator
<
(
const
Bounds
&
b
)
const
{
/* handle special case of zero-width bodies, which could otherwise get min/max swapped in the unstable std::sort */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment