After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 758455 - GspellChecker: add string length parameters
GspellChecker: add string length parameters
Status: RESOLVED FIXED
Product: gspell
Classification: Other
Component: general
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gspell maintainers
gspell maintainers
Depends on:
Blocks:
 
 
Reported: 2015-11-21 15:07 UTC by Sébastien Wilmet
Modified: 2015-11-22 17:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sébastien Wilmet 2015-11-21 15:07:47 UTC
The string length parameters would be used nowhere in gspell, currently. They would always be -1. But for some widgets it's probably possible to traverse the text without extracting each word… Doing lots of small memory allocations can be bad for performance, and doing stack allocation can be cumbersome if a word is longer than the buffer (and it still needs a copy).

So in the end, it's probably better to add string length parameters. Passing -1 is easy.

Only the GspellChecker class is concerned. For the signals, it's more convenient to not have the length parameters. The most important is for gspell_checker_check_word(), since it's called for every word, whereas the other functions are called less often.
Comment 1 Sébastien Wilmet 2015-11-22 17:47:37 UTC
Done.