---
title: "inefficient-map-lookup"
description: "Avoid repeated map lookups."
image: "https://strider.gempir.com/og.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://strider.gempir.com/llms.txt
> Use this file to discover all available pages before exploring further.

# inefficient-map-lookup

<!-- Code generated by docs/scripts/generate-check-docs.go; DO NOT EDIT. -->

**Default severity:** `error`

Avoid repeated map lookups.

## Bad

```go
if _, ok := values[key]; ok { use(values[key]) }
```

## Good

```go
if value, ok := values[key]; ok { use(value) }
```

Source: https://strider.gempir.com/lints/inefficient-map-lookup/index.mdx
