Skip to content

Commit c780f4e

Browse files
committed
Merge branch 'bugfix/RelatedTopicCollection-isInternal-overloads' into develop
In a previous set of commits, I moved the `RelatedTopicCollection` overloads which accepted `isIncoming` to be marked as `internal` (5e40470, 5706897). In setting up their public overloads, however, I inadvertantly introduced an infinite loop by a) failing to ensure they passed a value for `isIncoming`, and b) creating an ambiguous reference for the internal overload by making the `isIncoming` parameter optional. Whoops! This fixes that issue by ensuring the `public` version of `RemoveTopic()` defaults to setting `isIncoming` to `false`, and the `internal` version of `RemoveTopic()` doesn't assume a default for `isIncoming`.
2 parents e917f00 + 4f067bd commit c780f4e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

OnTopic/Collections/RelatedTopicCollection.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public void ClearTopics(string relationshipKey) {
133133
/// Returns true if the <see cref="Topic"/> is removed; returns false if either the relationship key or the
134134
/// <see cref="Topic"/> cannot be found.
135135
/// </returns>
136-
public bool RemoveTopic(string relationshipKey, string topicKey) => RemoveTopic(relationshipKey, topicKey);
136+
public bool RemoveTopic(string relationshipKey, string topicKey) => RemoveTopic(relationshipKey, topicKey, false);
137137

138138
/// <summary>
139139
/// Removes a specific <see cref="Topic"/> object associated with a specific relationship key.
@@ -147,7 +147,7 @@ public void ClearTopics(string relationshipKey) {
147147
/// Returns true if the <see cref="Topic"/> is removed; returns false if either the relationship key or the
148148
/// <see cref="Topic"/> cannot be found.
149149
/// </returns>
150-
internal bool RemoveTopic(string relationshipKey, string topicKey, bool isIncoming = false) {
150+
internal bool RemoveTopic(string relationshipKey, string topicKey, bool isIncoming) {
151151

152152
/*------------------------------------------------------------------------------------------------------------------------
153153
| Validate contracts
@@ -181,7 +181,7 @@ internal bool RemoveTopic(string relationshipKey, string topicKey, bool isIncomi
181181
/// Returns true if the <see cref="Topic"/> is removed; returns false if either the relationship key or the
182182
/// <see cref="Topic"/> cannot be found.
183183
/// </returns>
184-
public bool RemoveTopic(string relationshipKey, Topic topic) => RemoveTopic(relationshipKey, topic);
184+
public bool RemoveTopic(string relationshipKey, Topic topic) => RemoveTopic(relationshipKey, topic, false);
185185

186186

187187
/// <summary>
@@ -196,7 +196,7 @@ internal bool RemoveTopic(string relationshipKey, string topicKey, bool isIncomi
196196
/// Returns true if the <see cref="Topic"/> is removed; returns false if either the relationship key or the
197197
/// <see cref="Topic"/> cannot be found.
198198
/// </returns>
199-
internal bool RemoveTopic(string relationshipKey, Topic topic, bool isIncoming = false) {
199+
internal bool RemoveTopic(string relationshipKey, Topic topic, bool isIncoming) {
200200

201201
/*------------------------------------------------------------------------------------------------------------------------
202202
| Validate contracts
@@ -300,7 +300,7 @@ internal void SetTopic(string relationshipKey, Topic topic, bool? isDirty, bool
300300
nameof(isIncoming)
301301
);
302302
}
303-
topic.IncomingRelationships.SetTopic(relationshipKey, _parent, true);
303+
topic.IncomingRelationships.SetTopic(relationshipKey, _parent, isDirty, true);
304304
}
305305

306306
}

0 commit comments

Comments
 (0)