I dunno fix something.

This commit is contained in:
Pyral 2024-12-06 18:25:32 -05:00
parent 9681ad0a07
commit cf61dcf39c

View File

@ -17,8 +17,8 @@ static func create_meta_accessor(file_accessors:Array[VFileAccess])->VFileAccess
var accum:Array[String] = [] var accum:Array[String] = []
accum.assign( accum.assign(
file_accessors.reduce( file_accessors.reduce(
(func _merge_files(total:Array[String], current:VFileAccess)->Array[String]: (func _merge_files(total:Array, current:VFileAccess)->Array:
var res:Array[String] = total.duplicate() var res:Array = total.duplicate()
for file:String in current.get_files_at(path): for file:String in current.get_files_at(path):
if not file in total: if not file in total:
res.append(file) res.append(file)
@ -171,13 +171,13 @@ static func create_bulk_readonly_zip_access(
vfiler._get_files_at = func(path:String)->Array[String]: vfiler._get_files_at = func(path:String)->Array[String]:
if not path.ends_with("/"): # TODO ensure no // as well because that can be problem. if not path.ends_with("/"): # TODO ensure no // as well because that can be problem.
path += "/" # sorry for the mutation path += "/" # sorry for the mutation
var accum:Array[String] = [] var accum:Array = []
accum.assign( readers.reduce( accum.assign( readers.reduce(
(func _merge_files(total:Array[String], current:ZIPReader)->Array[String]: (func _merge_files(total:Array, current:ZIPReader)->Array:
var res:Array[String] = total.duplicate() var res:Array = total.duplicate()
var filtered:Array = [] var filtered:Array = []
filtered.assign(current.get_files()) filtered.assign(current.get_files())
filtered.filter( filtered = filtered.filter(
func _filter_dir(curpath:String)->bool: func _filter_dir(curpath:String)->bool:
return curpath.begins_with(path)) return curpath.begins_with(path))
for file:String in filtered: for file:String in filtered:
@ -186,6 +186,8 @@ static func create_bulk_readonly_zip_access(
if not file in total and not stripped_file.contains("/"): if not file in total and not stripped_file.contains("/"):
res.append(file) res.append(file)
return res) ,[])) return res) ,[]))
return accum var out_accum:Array[String] = []
out_accum.assign(accum)
return out_accum
return vfiler return vfiler