OSDN Git Service
(root)
/
opentween
/
open-tween.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4bea847
)
TabModel.AddSubmitメソッドの返値に追加済みのIDとして無視された分を含めない
author
Kimura Youichi
<kim.upsilon@bucyou.net>
Tue, 8 Nov 2016 13:13:57 +0000
(22:13 +0900)
committer
Kimura Youichi
<kim.upsilon@bucyou.net>
Fri, 11 Nov 2016 15:10:27 +0000
(
00:10
+0900)
OpenTween/Models/TabModel.cs
patch
|
blob
|
history
diff --git
a/OpenTween/Models/TabModel.cs
b/OpenTween/Models/TabModel.cs
index
3cca9c0
..
dca1983
100644
(file)
--- a/
OpenTween/Models/TabModel.cs
+++ b/
OpenTween/Models/TabModel.cs
@@
-103,14
+103,15
@@
namespace OpenTween.Models
}
//無条件に追加
}
//無条件に追加
- internal
void
AddPostImmediately(long statusId, bool read)
+ internal
bool
AddPostImmediately(long statusId, bool read)
{
{
- if (this._ids.Contains(statusId)) return;
-
- this._ids.Add(statusId);
+ if (!this._ids.Add(statusId))
+ return false;
if (!read)
this.unreadIds.Add(statusId);
if (!read)
this.unreadIds.Add(statusId);
+
+ return true;
}
public IList<long> AddSubmit()
}
public IList<long> AddSubmit()
@@
-120,8
+121,8
@@
namespace OpenTween.Models
TemporaryId tId;
while (this.addQueue.TryDequeue(out tId))
{
TemporaryId tId;
while (this.addQueue.TryDequeue(out tId))
{
- this.AddPostImmediately(tId.StatusId, tId.Read);
- addedIds.Add(tId.StatusId);
+ if (this.AddPostImmediately(tId.StatusId, tId.Read))
+
addedIds.Add(tId.StatusId);
}
return addedIds;
}
return addedIds;