Skip to content

Commit

Permalink
elide intermediate variable
Browse files Browse the repository at this point in the history
  • Loading branch information
gdmcbain committed Feb 2, 2022
1 parent 5e17b75 commit abb4578
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions skfem/mesh/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,11 @@ def _decode_cell_data(self, cell_data: Dict[str, List[ndarray]]):
subdomains[subnames[2]] = np.nonzero(data[0])[0]
elif subnames[1] == "b":
oriented = data[0].max() > 2 ** self.t2f.shape[0] - 1
powers = 1 << np.arange(self.t2f.shape[0] * (1 + oriented))[:, None]
indices = powers & data[0].astype(np.int64) > 0
indices = (
1 << np.arange(self.t2f.shape[0] * (1 + oriented))[:, None]
& data[0].astype(np.int64)
> 0
)
if oriented:
oriented_facets = (
self.t2f[indices[: self.t2f.shape[0]]],
Expand Down

0 comments on commit abb4578

Please sign in to comment.