Bug 1135022 - Clean up ChunkSet API. r=mmc

This commit is contained in:
Gian-Carlo Pascutto 2015-02-20 15:05:41 +01:00
parent 9bf0036576
commit f02647021c
2 changed files with 3 additions and 19 deletions

View File

@ -48,14 +48,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:
FallibleTArray<uint32_t> mChunks;
};