Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix caching for zsh completions #1951

Closed
wants to merge 1 commit into from
Closed

Fix caching for zsh completions #1951

wants to merge 1 commit into from

Conversation

natebosch
Copy link
Contributor

Before - failing to find completions in the relevant variable would always
force getting them fresh, regardless of whether they are present in the cache
because the || would always be true.

  • in _bazel_get_options use a short circuit return when the variable is not
    empty
  • in _bazel_command, _bazel_help_topic, and _bazel_info_key nest the cache
    conditions inside the if block checking for an empty varible

cleanup:

  • Use the same 2 space indent for continued conditions in _bazel_get_options as
    was already used in _bazel_command and the rest

Before - failing to find completions in the relevant variable would always
force getting them fresh, regardless of whether they are present in the cache
because the `||` would always be true.

- in _bazel_get_options use a short circuit return when the variable is not
  empty
- in _bazel_command, _bazel_help_topic, and _bazel_info_key nest the cache
  conditions inside the if block checking for an empty varible

cleanup:
- Use the same 2 space indent for continued conditions in _bazel_get_options as
  was already used in _bazel_command and the rest
@bazel-io
Copy link
Member

Can one of the admins verify this patch?

@damienmg
Copy link
Contributor

LGTM

@bazel-io bazel-io closed this in fae3c0c Oct 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants