Agent skill
optimizing-fast-lookup-lite
Provides essential fast lookup patterns with HashSet and Dictionary. Use when quickly referencing core O(1) lookup techniques without detailed explanations.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/optimizing-fast-lookup-lite
SKILL.md
Fast Lookup Essentials
1. HashSet<T>
// O(1) existence check
var allowedIds = new HashSet<int> { 1, 2, 3, 4, 5 };
if (allowedIds.Contains(userId))
{
// Allowed user
}
2. FrozenSet<T> (.NET 8+)
using System.Collections.Frozen;
// Immutable fast lookup
var allowedExtensions = new[] { ".jpg", ".png", ".gif" }
.ToFrozenSet(StringComparer.OrdinalIgnoreCase);
3. Dictionary Optimization
// ❌ Two lookups
if (dict.ContainsKey(key))
var value = dict[key];
// ✅ Single lookup
if (dict.TryGetValue(key, out var value))
{
// Use value
}
4. When to Use
| Scenario | Recommended Collection |
|---|---|
| Frequently modified set | HashSet<T> |
| Read-only configuration | FrozenSet<T> |
| Key-Value cache | Dictionary<K,V> |
For details: See
/dotnet-fast-lookupskill
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?