[pbs-devel] [PATCH proxmox 1/2] api-macro: fix broken binary ident search

Dietmar Maurer dietmar at proxmox.com
Thu Sep 17 08:34:54 CEST 2020


> On 09/17/2020 6:25 AM Dietmar Maurer <dietmar at proxmox.com> wrote:
> 
>  
> > @@ -394,6 +397,9 @@ impl SchemaObject {
> >  
> >      fn sort_properties(&mut self) {
> >          self.properties_.sort_by(|a, b| (a.0).cmp(&b.0));
> > +        for (idx, prop) in self.properties_.iter().enumerate() {
> > +            self.ident_hash.insert(prop.0.as_ident_str().to_string(), idx);
> > +        }
> >      }
> >  
> 
> Above looks really wrong to me. Why should we repopulate the whole hash in sort_properties()?

Ok, finally got it. We only call sort once there, so this is actually ok.





More information about the pbs-devel mailing list