Skip to content

Commit

Permalink
Reduce FieldPath size.
Browse files Browse the repository at this point in the history
  • Loading branch information
abenea committed Feb 17, 2024
1 parent 7c80f50 commit f2082e6
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 105 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion cs2-demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ snap = "1.1"
thiserror = "1.0"
tracing = "0.1"
paste = "1.0"
smallvec = "1.13.1"

[build-dependencies]
protobuf-codegen = "3.2"
6 changes: 3 additions & 3 deletions cs2-demo/src/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,17 +185,17 @@ impl Entity {
fps.clear();
loop {
fp.read(reader)?;
if fp.finished {
if fp.len() == 0 {
break;
}
fps.push(fp.clone());
}
for fp in fps {
let (prop, field) = self.property(&fp.data);
let (prop, field) = self.property(fp.data());
*prop = (field.decoder())(reader)?;

if enabled!(Level::TRACE) {
let (prop, field, name) = self.get_property(&fp.data);
let (prop, field, name) = self.get_property(fp.data());
match field {
Field::Value(_) | Field::Array(_) | Field::Vector(_) => {
trace!("{fp} {}: {} = {}", name, field.ctype(), prop.unwrap())
Expand Down

0 comments on commit f2082e6

Please sign in to comment.