Skip to content

This function is really inefficient: Plane::as_data_flatten #119

@LetsMelon

Description

@LetsMelon

pub fn as_data_flatten(&self) -> Vec<u8> {

I think it would be a good idea to replace the current function body with

let total_len = self.data.len() * 4;
let mut result = Vec::with_capacity(total_len);

for p in &self.data {
  result.extend_from_slice(&p.to_raw());
}

result

, but before that the two versions must be bench marked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions