Bug 1135022 - Clean up ChunkSet API. r=mmc

This commit is contained in:
Gian-Carlo Pascutto 2015-02-25 14:05:10 +01:00
parent 2724dd55e4
commit 6b723f76e7
2 changed files with 3 additions and 19 deletions

View File

@ -46,14 +46,6 @@ ChunkSet::Set(uint32_t aChunk)
return NS_OK;
}
nsresult
ChunkSet::Unset(uint32_t aChunk)
{
mChunks.RemoveElementSorted(aChunk);
return NS_OK;
}
bool
ChunkSet::Has(uint32_t aChunk) const
{

View File

@ -6,7 +6,6 @@
#ifndef ChunkSet_h__
#define ChunkSet_h__
#include "Entries.h"
#include "nsString.h"
#include "nsTArray.h"
@ -27,26 +26,19 @@ public:
nsresult Serialize(nsACString& aStr);
nsresult Set(uint32_t aChunk);
nsresult Unset(uint32_t aChunk);
void Clear();
nsresult Merge(const ChunkSet& aOther);
nsresult Remove(const ChunkSet& aOther);
bool Has(uint32_t chunk) const;
nsresult Merge(const ChunkSet& aOther);
uint32_t Length() const { return mChunks.Length(); }
nsresult Remove(const ChunkSet& aOther);
void Clear();
nsresult Write(nsIOutputStream* aOut) {
return WriteTArray(aOut, mChunks);
}
nsresult Read(nsIInputStream* aIn, uint32_t aNumElements) {
return ReadTArray(aIn, &mChunks, aNumElements);
}
uint32_t *Begin() { return mChunks.Elements(); }
uint32_t *End() { return mChunks.Elements() + mChunks.Length(); }
private:
nsTArray<uint32_t> mChunks;
};