indexer: Re-use memory buffer when reading RPM repo data
This avoids reading the entire uncompressed XML into a buffer.
This commit is contained in:
parent
cec70a59c4
commit
7aa89145ca
1 changed files with 2 additions and 0 deletions
|
|
@ -73,6 +73,7 @@ fn readpkgs<F>(url: String, mut cb: F) -> Result<(),Box<Error>>
|
|||
let arch_src = Some("src".to_string());
|
||||
|
||||
loop {
|
||||
buf.clear();
|
||||
let event = xml.read_event(&mut buf);
|
||||
let event = event.map_err(to_err)?;
|
||||
|
||||
|
|
@ -141,6 +142,7 @@ fn repomd(url: String) -> Result<(String,String),Box<Error>> {
|
|||
let mut buf = Vec::new();
|
||||
|
||||
loop {
|
||||
buf.clear();
|
||||
let event = xml.read_event(&mut buf).map_err(to_err)?;
|
||||
match event {
|
||||
Event::Start(ref e) |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue