Skip to content

Commit fc65d5f

Browse files
committed
add qualifier
1 parent e95583a commit fc65d5f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/heap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ namespace alg {
121121
/**
122122
* remove the given data
123123
*/
124-
bool remove(T data) {
124+
bool remove(const T &data) {
125125
for (int i=0;i<m_size;i++) { // loop finding
126126
if (m_heap[i].data == data) { // found
127127
int n = m_size-1;
@@ -141,7 +141,7 @@ namespace alg {
141141
* decrease key
142142
* simpliy implemented as remove then push
143143
*/
144-
void decrease_key(T data, int newkey) {
144+
void decrease_key(const T &data, int newkey) {
145145
if (remove(data)) {
146146
push(newkey, data);
147147
}

0 commit comments

Comments
 (0)