/*
 * Copyright © 2021-2026 Pierrick Caillon <pierrick.caillon+zipdirfs@megami.fr>
 */
#include "ZipDirFs/Utilities/list_cleanup.h"

namespace ZipDirFs::Utilities
{
	void CleanupEntryList(Containers::Helpers::EntryListProxy& proxy,
		Containers::Helpers::Factory& factory)
	{
		auto it = proxy.begin();
		const auto endIt = proxy.end();
		while (!(it == endIt))
		{
			factory.destroy(proxy.find(*it));
			it = proxy.erase(it);
		}
	}
} // namespace ZipDirFs::Utilities
