D22023: Don't allow variable names equal to function or constant names

Alexander Semke noreply at phabricator.kde.org
Sun Jun 23 12:40:50 BST 2019


asemke added inline comments.

INLINE COMMENTS

> FunctionValuesDialog.cpp:163
> +bool FunctionValuesDialog::validVariableName(QLineEdit* le) {
> +	for (auto name : ExpressionParser::getInstance()->constants()) {
> +		if (name.compare(le->text()) == 0) {

why not to search with constants().indexOf(name) and comparing the found index with -1?

REPOSITORY
  R262 LabPlot

REVISION DETAIL
  https://phabricator.kde.org/D22023

To: Murmele, asemke
Cc: kde-edu, narvaez, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20190623/62a4f5eb/attachment.html>


More information about the kde-edu mailing list