Re: new function for tsquery creartion

Поиск
Список
Период
Сортировка
От Aleksander Alekseev
Тема Re: new function for tsquery creartion
Дата
Msg-id 151602125554.25640.2584561162347369841.pgcf@coridan.postgresql.org
обсуждение исходный текст
Ответ на Re: new function for tsquery creartion  (Victor Drobny <v.drobny@postgrespro.ru>)
Список pgsql-hackers
The following review has been posted through the commitfest application:
make installcheck-world:  tested, passed
Implements feature:       tested, passed
Spec compliant:           tested, passed
Documentation:            tested, passed

Here are a few minor issues:

```
+/*
+ * Checks if 'str' starts with a 'prefix'
+ */
+static bool
+has_prefix(char * str, char * prefix)
+{
+   if (strlen(prefix) > strlen(str))
+   {
+       return false;
+   }
+   return strstr(str, prefix) == str;
+}
```

strlen() check is redundant.

```
+           case OP_AROUND:
+               snprintf(in->cur, 256, " AROUND(%d) %s", distance, nrm.buf);
+               break;
```

Instead of the constant 256 it's better to use sizeof().

Apart from these issues this patch looks not bad.

The new status of this patch is: Ready for Committer

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

Предыдущее
От: Joe Wildish
Дата:
Сообщение: Re: Implementing SQL ASSERTION
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: WIP: a way forward on bootstrap data