[analyzer] Minor optimization: avoid setting state if unchanged
[analyzer] Minor optimization: avoid setting state if unchanged

Summary: Split out optimization from D26061

Reviewers: zaks.anna, dcoughlin

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D26642

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@286925 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit 400a9bf83c05e714e10c39bf3e8d62778a2df6f5)

apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang