From d6a38c8e447ffff09d4e5c691bf228a0267f104d Mon Sep 17 00:00:00 2001 From: stephena Date: Thu, 30 Sep 2010 15:56:38 +0000 Subject: [PATCH] Changed several string invocations to use references instead. For the Cart class it's simply an optimization, but the Distella change actually modifies the list of addresses (vs. modifying a copy of the list). git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2137 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- src/debugger/DiStella.cxx | 2 +- src/emucore/Cart.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/debugger/DiStella.cxx b/src/debugger/DiStella.cxx index dac625605..eddc5b08f 100644 --- a/src/debugger/DiStella.cxx +++ b/src/debugger/DiStella.cxx @@ -27,7 +27,7 @@ DiStella::DiStella(const CartDebug& dbg, CartDebug::DisassemblyList& list, : myDbg(dbg), myList(list) { - CartDebug::AddressList addresses = info.addressList; + CartDebug::AddressList& addresses = info.addressList; if(addresses.size() == 0) return; diff --git a/src/emucore/Cart.cxx b/src/emucore/Cart.cxx index 7e5236044..40a2a37b8 100644 --- a/src/emucore/Cart.cxx +++ b/src/emucore/Cart.cxx @@ -73,7 +73,7 @@ Cartridge* Cartridge::create(const uInt8* image, uInt32 size, string& md5, string autodetect = ""; if(type == "AUTO-DETECT" || settings.getBool("rominfo")) { - string detected = autodetectType(image, size); + const string& detected = autodetectType(image, size); autodetect = "*"; if(type != "AUTO-DETECT" && type != detected) cerr << "Auto-detection not consistent: " << type << ", " << detected << endl;