Skip to content

Commit

Permalink
optimize azalea-core positions and remove some unnecessary nightly fe…
Browse files Browse the repository at this point in the history
…atures
  • Loading branch information
mat-1 committed Oct 27, 2023
1 parent 252958b commit ce81ae9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 0 additions & 2 deletions azalea-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#![doc = include_str!("../README.md")]
#![feature(int_roundings)]
#![feature(const_for)]
#![feature(lazy_cell)]
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
Expand Down
18 changes: 9 additions & 9 deletions azalea-core/src/position.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,17 +352,17 @@ impl From<&BlockPos> for ChunkPos {
#[inline]
fn from(pos: &BlockPos) -> Self {
ChunkPos {
x: pos.x.div_floor(16),
z: pos.z.div_floor(16),
x: pos.x >> 4,
z: pos.z >> 4,
}
}
}
impl From<BlockPos> for ChunkPos {
#[inline]
fn from(pos: BlockPos) -> Self {
ChunkPos {
x: pos.x.div_floor(16),
z: pos.z.div_floor(16),
x: pos.x >> 4,
z: pos.z >> 4,
}
}
}
Expand Down Expand Up @@ -398,19 +398,19 @@ impl From<&BlockPos> for ChunkBlockPos {
#[inline]
fn from(pos: &BlockPos) -> Self {
ChunkBlockPos {
x: pos.x.rem_euclid(16) as u8,
x: (pos.x & 0xF) as u8,
y: pos.y,
z: pos.z.rem_euclid(16) as u8,
z: (pos.z & 0xF) as u8,
}
}
}
impl From<BlockPos> for ChunkBlockPos {
#[inline]
fn from(pos: BlockPos) -> Self {
ChunkBlockPos {
x: pos.x.rem_euclid(16) as u8,
x: (pos.x & 0xF) as u8,
y: pos.y,
z: pos.z.rem_euclid(16) as u8,
z: (pos.z & 0xF) as u8,
}
}
}
Expand All @@ -431,7 +431,7 @@ impl From<&ChunkBlockPos> for ChunkSectionBlockPos {
fn from(pos: &ChunkBlockPos) -> Self {
ChunkSectionBlockPos {
x: pos.x,
y: pos.y.rem_euclid(16) as u8,
y: (pos.y & 0xF) as u8,
z: pos.z,
}
}
Expand Down

0 comments on commit ce81ae9

Please sign in to comment.