Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Conversation

@beyackle
Copy link
Contributor

@beyackle beyackle commented Jun 1, 2020

Description

This replaces tildes across the codebase with easier-to-read equivalents (e.g. ~array.indexOf(x) becomes array.includes(x)).

Task Item

refs #3307

@coveralls
Copy link

coveralls commented Jun 1, 2020

Coverage Status

Coverage remained the same at 47.723% when pulling b3d4c38 on beyackle/tildes into 19b1b42 on master.

@beyackle beyackle marked this pull request as draft June 1, 2020 21:40
@beyackle beyackle marked this pull request as ready for review June 1, 2020 23:03
//add the lu file that are not in interuption folder.
files.forEach((file) => {
if (!~paths.indexOf(file.name)) {
if (!paths.includes(file.name)) {
Copy link
Contributor

@srinaath srinaath Jun 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This becomes a O(ab) with the lookup inside for loop. Can paths be a Set?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured most of this code was already there. If u have time for a little cleanup will be great

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

~types.indexOf(ExpressionTypeMapString[returnType]) ||
(returnType === ReturnType.Number && ~types.indexOf(ExpressionType.integer))
types.includes(ExpressionTypeMapString[returnType]) ||
(returnType === ReturnType.Number && types.includes(ExpressionType.integer))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cant this just be types[ExpressionType.integer] instead of doing includes everytime?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor Author

@beyackle beyackle Jun 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this again, I'm not sure we can do anything about it yet. Types is an array but ExpressionType.integer is a string; we want to check if the string is a value in the array, so includes is appropriate here. The more correct thing here would be to make types a Set<string>, but that ought to be its own cleanup ticket later - it's a non-trivial amount of work.

@a-b-r-o-w-n
Copy link
Contributor

@beyackle consider adding the no-bitwise rule to our eslint config as well.

@beyackle
Copy link
Contributor Author

beyackle commented Jun 2, 2020

@beyackle consider adding the no-bitwise rule to our eslint config as well.

That's an excellent idea. I didn't know that existed, but I'll add it in.

@a-b-r-o-w-n
Copy link
Contributor

@srinaath can you revisit this PR today?

srinaath
srinaath previously approved these changes Jun 15, 2020
@srinaath
Copy link
Contributor

PR is good on my end. Once @a-b-r-o-w-n approves i think we are good to merge

@a-b-r-o-w-n a-b-r-o-w-n merged commit bac3e28 into master Jun 16, 2020
@a-b-r-o-w-n a-b-r-o-w-n deleted the beyackle/tildes branch June 16, 2020 15:45
@cwhitten cwhitten mentioned this pull request Jul 8, 2020
lei9444 pushed a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
* remove tildes

* add no-bitwise rule

* update luPublisher with typo fixes and some cleanup

* fix typo

* remove tildes

* add no-bitwise rule

* update luPublisher with typo fixes and some cleanup

* fix typo

* fix endpoint issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants