Remove meaningless const qualifier from ginCompressPostingList()

Поиск
Список
Период
Сортировка
От Chao Li
Тема Remove meaningless const qualifier from ginCompressPostingList()
Дата
Msg-id CAEoWx2kTDz=b6T2xHX78vy_B_osDeCC5dcTCi9eG0vXHp5QpdQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Remove meaningless const qualifier from ginCompressPostingList()
Список pgsql-hackers
Hi Hacker,

While working on the other patch that fixed wrong "const" usage [1], I found the function:
```
GinPostingList *
ginCompressPostingList(const ItemPointer ipd, int nipd, int maxsize,
  int *nwritten)
```
uses "const" unnecessarily. Because it needs to assign an element of "ipd" to the returned structure "GinPostingList->first" and "first" is a mutable "ItemPointerData *", so that "ipd" cannot be of const pointer.

With the current usage, "const" only protects "ipd" itself from updating, which is meaningless. Thus the "const" only adds confusion to code readers, so I am deleting it. 


Chao Li (Evan)
---------------------
HighGo Software Co., Ltd.
https://www.highgo.com/
Вложения

В списке pgsql-hackers по дате отправления: