{
  "id": 7451599,
  "title": "From 3ms to 0ms: The Hidden Memory Trap in C++ Maps",
  "url": "https://urgent.news/2026/09/15/from-3ms-to-0ms-the-hidden-memory-trap-in-c-maps",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-15T02:12:16.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/jeet_0474/from-3ms-to-0ms-the-hidden-memory-trap-in-c-maps-4m3h"
  },
  "original_language": "en",
  "account": null,
  "summary": "From 3ms to 0ms: The Hidden Memory Trap in C++ Maps I thought I was writing the cleanest one-liner of my life. To solve Two Sum, I stored 1-based indices in an unordered_map so I could check for complements directly inside an if statement: if ( mp [ target - nums [ i ]]) { return { mp [ target - nums [ i ]] - 1 , i }; } It passed. But it took 3ms . On a whim, I swapped that single line to…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}