summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-01-25 14:27:41 -0800
committerGlenn Kasten <gkasten@google.com>2012-01-27 16:30:45 -0800
commite478742ca742a2121e4bdc22914e7a4d5fed65a6 (patch)
treec7dc464efa2b22b232d69d87304dc5d6c4eff0df
parentcf0c7d1031ea213c1b728aca972522afcd4a92c3 (diff)
downloadframeworks_base-e478742ca742a2121e4bdc22914e7a4d5fed65a6.zip
frameworks_base-e478742ca742a2121e4bdc22914e7a4d5fed65a6.tar.gz
frameworks_base-e478742ca742a2121e4bdc22914e7a4d5fed65a6.tar.bz2
No need to check a wp<> for 0 before promote()
Also remove unnecessary wp<> local variable. Change-Id: I620e67b5d559d28616f8e00609a525cfe19c5ddc
-rw-r--r--services/audioflinger/AudioFlinger.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 2d856ad..f8ad3df 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -265,13 +265,10 @@ status_t AudioFlinger::dumpClients(int fd, const Vector<String16>& args)
result.append("Clients:\n");
for (size_t i = 0; i < mClients.size(); ++i) {
- wp<Client> wClient = mClients.valueAt(i);
- if (wClient != 0) {
- sp<Client> client = wClient.promote();
- if (client != 0) {
- snprintf(buffer, SIZE, " pid: %d\n", client->pid());
- result.append(buffer);
- }
+ sp<Client> client = mClients.valueAt(i).promote();
+ if (client != 0) {
+ snprintf(buffer, SIZE, " pid: %d\n", client->pid());
+ result.append(buffer);
}
}
@@ -1431,13 +1428,10 @@ status_t AudioFlinger::PlaybackThread::dumpTracks(int fd, const Vector<String16>
result.append(buffer);
result.append(" Name Clien Typ Fmt Chn mask Session Buf S M F SRate LeftV RighV Serv User Main buf Aux Buf\n");
for (size_t i = 0; i < mActiveTracks.size(); ++i) {
- wp<Track> wTrack = mActiveTracks[i];
- if (wTrack != 0) {
- sp<Track> track = wTrack.promote();
- if (track != 0) {
- track->dump(buffer, SIZE);
- result.append(buffer);
- }
+ sp<Track> track = mActiveTracks[i].promote();
+ if (track != 0) {
+ track->dump(buffer, SIZE);
+ result.append(buffer);
}
}
write(fd, result.string(), result.size());