From 8d9809ed25a716c5b2800b29679af38969602242 Mon Sep 17 00:00:00 2001 From: Imbris Date: Tue, 16 Mar 2021 03:56:43 -0400 Subject: [PATCH] update changelog, clippy fixes --- CHANGELOG.md | 1 + Cargo.lock | 1 - client/src/lib.rs | 1 - common/base/src/lib.rs | 4 +++- common/sys/Cargo.toml | 2 +- common/sys/src/lib.rs | 1 + common/sys/src/phys.rs | 22 ++++++++-------------- 7 files changed, 14 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fbee0afeb2..f19402b1aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Changed sunlight (and, in general, static light) propagation through blocks to allow for more material properties - Overhauled the sceptre - Make the /time command relative to the current day +- Spatial partitioning via a grid for entity versus entity collisions was added which can more than halve the total tick time at higher entity counts (> ~1000) ### Removed diff --git a/Cargo.lock b/Cargo.lock index a0e3ae1f44..c16404c034 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5633,7 +5633,6 @@ dependencies = [ "bincode", "hashbrown", "indexmap", - "inline_tweak", "rand 0.8.3", "rayon", "scopeguard", diff --git a/client/src/lib.rs b/client/src/lib.rs index 696c97a889..1edebd7015 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -244,7 +244,6 @@ impl Client { ping_stream.send(PingMsg::Ping)?; - let mut ping_interval = tokio::time::interval(core::time::Duration::from_secs(1)); // Wait for initial sync let mut ping_interval = tokio::time::interval(core::time::Duration::from_secs(1)); let ( diff --git a/common/base/src/lib.rs b/common/base/src/lib.rs index 3042e738a6..4f9d8ed951 100644 --- a/common/base/src/lib.rs +++ b/common/base/src/lib.rs @@ -58,6 +58,8 @@ macro_rules! span { }; } +pub struct DummySpan; + /// Like the span macro but only used when profiling and not in regular tracing /// operations #[macro_export] @@ -73,7 +75,7 @@ macro_rules! prof_span { 0, ); #[cfg(not(feature = "tracy"))] - let $guard_name = (); + let $guard_name = $crate::DummySpan; }; } diff --git a/common/sys/Cargo.toml b/common/sys/Cargo.toml index b16366ef81..623b7152ac 100644 --- a/common/sys/Cargo.toml +++ b/common/sys/Cargo.toml @@ -42,4 +42,4 @@ bincode = { version = "1.3.1", optional = true } plugin-api = { package = "veloren-plugin-api", path = "../../plugin/api", optional = true } # Tweak running code -inline_tweak = { version = "1.0.8", features = ["release_tweak"] } +# inline_tweak = { version = "1.0.8", features = ["release_tweak"] } diff --git a/common/sys/src/lib.rs b/common/sys/src/lib.rs index 6292b30311..c38136dc52 100644 --- a/common/sys/src/lib.rs +++ b/common/sys/src/lib.rs @@ -1,4 +1,5 @@ #![feature(label_break_value, bool_to_option, option_unwrap_none)] +#![allow(clippy::option_map_unit_fn)] mod aura; mod beam; diff --git a/common/sys/src/phys.rs b/common/sys/src/phys.rs index 1b9b62949e..3dd4560d69 100644 --- a/common/sys/src/phys.rs +++ b/common/sys/src/phys.rs @@ -885,20 +885,14 @@ impl<'a> PhysicsData<'a> { land_on_ground }, ) - .fold( - || Vec::new(), - |mut land_on_grounds, land_on_ground| { - land_on_ground.map(|log| land_on_grounds.push(log)); - land_on_grounds - }, - ) - .reduce( - || Vec::new(), - |mut land_on_grounds_a, mut land_on_grounds_b| { - land_on_grounds_a.append(&mut land_on_grounds_b); - land_on_grounds_a - }, - ); + .fold(Vec::new, |mut land_on_grounds, land_on_ground| { + land_on_ground.map(|log| land_on_grounds.push(log)); + land_on_grounds + }) + .reduce(Vec::new, |mut land_on_grounds_a, mut land_on_grounds_b| { + land_on_grounds_a.append(&mut land_on_grounds_b); + land_on_grounds_a + }); drop(guard); job.cpu_stats.measure(ParMode::Single);