Revert "minedmap: store region list in BTreeSet"

This reverts commit b53d34da3d.

With the change of the mipmapper data structure, we need a conversion
step anyways, so we can keep using the Vec before mipmapping.
This commit is contained in:
Matthias Schiffer 2023-07-02 22:19:35 +02:00
parent b63a18ad6f
commit f9fc9efe8d
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
4 changed files with 10 additions and 12 deletions

View file

@ -1,4 +1,4 @@
use std::{collections::BTreeSet, path::Path};
use std::path::Path;
use anyhow::{Context, Result};
@ -120,7 +120,7 @@ impl<'a> RegionProcessor<'a> {
/// Iterates over all region files of a Minecraft save directory
///
/// Returns a list of the coordinates of all processed regions
pub fn run(self) -> Result<BTreeSet<TileCoords>> {
pub fn run(self) -> Result<Vec<TileCoords>> {
let read_dir = self.config.region_dir.read_dir().with_context(|| {
format!(
"Failed to read directory {}",
@ -131,7 +131,7 @@ impl<'a> RegionProcessor<'a> {
fs::create_dir_all(&self.config.processed_dir)?;
fs::create_dir_all(&self.config.tile_dir(TileKind::Lightmap, 0))?;
let mut ret = BTreeSet::new();
let mut ret = Vec::new();
for entry in read_dir.filter_map(|entry| entry.ok()).filter(|entry| {
// We are only interested in regular files
@ -153,7 +153,7 @@ impl<'a> RegionProcessor<'a> {
);
}
ret.insert(coords);
ret.push(coords);
}
Ok(ret)