mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-03 03:36:58 -04:00
changed std::vector into std::set in notification system, hence removing lots of std::find(std::vector::begin(),std::vector::end(),T), causing quadratic costs in multiple places.
This commit is contained in:
parent
6139632378
commit
84699db744
36 changed files with 208 additions and 272 deletions
|
@ -40,8 +40,8 @@ class RsGxsChanges
|
|||
public:
|
||||
RsGxsChanges(): mService(0){}
|
||||
RsTokenService *mService;
|
||||
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > mMsgs;
|
||||
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > mMsgsMeta;
|
||||
std::map<RsGxsGroupId, std::set<RsGxsMessageId> > mMsgs;
|
||||
std::map<RsGxsGroupId, std::set<RsGxsMessageId> > mMsgsMeta;
|
||||
std::list<RsGxsGroupId> mGrps;
|
||||
std::list<RsGxsGroupId> mGrpsMeta;
|
||||
};
|
||||
|
|
|
@ -43,10 +43,10 @@ typedef Sha1CheckSum RsGxsMessageId;
|
|||
typedef GXSId RsGxsId;
|
||||
typedef GXSCircleId RsGxsCircleId;
|
||||
|
||||
typedef std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > GxsMsgIdResult;
|
||||
typedef std::map<RsGxsGroupId, std::set<RsGxsMessageId> > GxsMsgIdResult;
|
||||
typedef std::pair<RsGxsGroupId, RsGxsMessageId> RsGxsGrpMsgIdPair;
|
||||
typedef std::map<RsGxsGrpMsgIdPair, std::vector<RsGxsMessageId> > MsgRelatedIdResult;
|
||||
typedef std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > GxsMsgReq;
|
||||
typedef std::map<RsGxsGrpMsgIdPair, std::set<RsGxsMessageId> > MsgRelatedIdResult;
|
||||
typedef std::map<RsGxsGroupId, std::set<RsGxsMessageId> > GxsMsgReq;
|
||||
|
||||
struct RsMsgMetaData;
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ class RsGxsMsgChange : public RsGxsNotify
|
|||
{
|
||||
public:
|
||||
RsGxsMsgChange(NotifyType type, bool metaChange) : NOTIFY_TYPE(type), mMetaChange(metaChange) {}
|
||||
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > msgChangeMap;
|
||||
std::map<RsGxsGroupId, std::set<RsGxsMessageId> > msgChangeMap;
|
||||
NotifyType getType(){ return NOTIFY_TYPE;}
|
||||
bool metaChange() { return mMetaChange; }
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue