You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by jacksontj <gi...@git.apache.org> on 2016/06/14 16:15:33 UTC

[GitHub] trafficserver pull request #708: TS-4537 Add `erase` method to PriorityQueue

GitHub user jacksontj opened a pull request:

    https://github.com/apache/trafficserver/pull/708

    TS-4537 Add `erase` method to PriorityQueue

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jacksontj/trafficserver TS-4537

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/trafficserver/pull/708.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #708
    
----

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #708: TS-4537 Add `erase` method to PriorityQueue

Posted by atsci <gi...@git.apache.org>.
Github user atsci commented on the issue:

    https://github.com/apache/trafficserver/pull/708
  
    FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/263/ for details.
     



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #708: TS-4537 Add `erase` method to PriorityQueue

Posted by atsci <gi...@git.apache.org>.
Github user atsci commented on the issue:

    https://github.com/apache/trafficserver/pull/708
  
    FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/283/ for details.
     



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #708: TS-4537 Add `erase` method to PriorityQueue

Posted by atsci <gi...@git.apache.org>.
Github user atsci commented on the issue:

    https://github.com/apache/trafficserver/pull/708
  
    FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/260/ for details.
     



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request #708: TS-4537 Add `erase` method to PriorityQueue

Posted by jacksontj <gi...@git.apache.org>.
Github user jacksontj closed the pull request at:

    https://github.com/apache/trafficserver/pull/708


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #708: TS-4537 Add `erase` method to PriorityQueue

Posted by atsci <gi...@git.apache.org>.
Github user atsci commented on the issue:

    https://github.com/apache/trafficserver/pull/708
  
    Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/175/ for details.
     



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #708: TS-4537 Add `erase` method to PriorityQueue

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on the issue:

    https://github.com/apache/trafficserver/pull/708
  
    Ping @masaori335 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request #708: TS-4537 Add `erase` method to PriorityQueue

Posted by masaori335 <gi...@git.apache.org>.
Github user masaori335 commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/708#discussion_r67087190
  
    --- Diff: lib/ts/PriorityQueue.h ---
    @@ -115,6 +117,22 @@ PriorityQueue<T, Comp>::pop()
     
     template <typename T, typename Comp>
     void
    +PriorityQueue<T, Comp>::erase(PriorityQueueEntry<T> *entry)
    +{
    +  if (empty()) {
    +    return;
    +  }
    +
    +  _v.remove_index(entry->index);
    +
    +  // Correct all of the indexes for the removed items
    +  for (unsigned int idx = entry->index; idx < _v.length(); idx++) {
    --- End diff --
    
    IMO, we can avoid rewriting all of the indexes because this is Binary Heap.
    How about this like what we're doing in `PriorityQueue<T, Comp>::pop()` ?
    
    ```
    _v[entry->index] = _v[_v.length() - 1];
    _v.pop();
    _bubble_down(entry->index);
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #708: TS-4537 Add `erase` method to PriorityQueue

Posted by masaori335 <gi...@git.apache.org>.
Github user masaori335 commented on the issue:

    https://github.com/apache/trafficserver/pull/708
  
    Looks good.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #708: TS-4537 Add `erase` method to PriorityQueue

Posted by atsci <gi...@git.apache.org>.
Github user atsci commented on the issue:

    https://github.com/apache/trafficserver/pull/708
  
    Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/158/ for details.
     



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---