From c83e5e076be04398c209fc0854246f9dea0e055c Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 5 Nov 2025 16:41:26 -0600 Subject: [PATCH] cleanup --- .ai/instructions.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.ai/instructions.md b/.ai/instructions.md index fbff419efa1..bb87eb3050a 100644 --- a/.ai/instructions.md +++ b/.ai/instructions.md @@ -71,10 +71,17 @@ This document provides essential context for AI models interacting with this pro this->current_option_ = nullptr; // Reset to prevent dangling pointer } void set_selected_option(const std::string *option) { - // Validate that option points to an entry in options_ - if (std::find(this->options_.begin(), this->options_.end(), *option) != this->options_.end()) { - this->current_option_ = option; + // Validate that option points to an entry in options_ by checking address range + if (option == nullptr) { + return; } + for (const auto &opt : this->options_) { + if (&opt == option) { + this->current_option_ = option; + return; + } + } + // Invalid pointer - doesn't point to an element in options_ } private: std::vector options_;