Browse Source

Minor cleanups.

tags/2021-05-28
jules 13 years ago
parent
commit
48ffccb8b8
3 changed files with 9 additions and 2 deletions
  1. +4
    -2
      modules/juce_core/containers/juce_NamedValueSet.cpp
  2. +4
    -0
      modules/juce_core/native/juce_posix_SharedCode.h
  3. +1
    -0
      modules/juce_data_structures/values/juce_ValueTree.cpp

+ 4
- 2
modules/juce_core/containers/juce_NamedValueSet.cpp View File

@@ -149,8 +149,10 @@ const var& NamedValueSet::operator[] (const Identifier& name) const
var NamedValueSet::getWithDefault (const Identifier& name, const var& defaultReturnValue) const
{
const var* const v = getVarPointer (name);
return v != nullptr ? *v : defaultReturnValue;
if (const var* const v = getVarPointer (name))
return *v;
return defaultReturnValue;
}
var* NamedValueSet::getVarPointer (const Identifier& name) const noexcept


+ 4
- 0
modules/juce_core/native/juce_posix_SharedCode.h View File

@@ -517,6 +517,10 @@ void FileOutputStream::flushInternal()
status = getResultForErrno();
#if JUCE_ANDROID
// This stuff tells the OS to asynchronously update the metadata
// that the OS has cached aboud the file - this metadata is used
// when the device is acting as a USB drive, and unless it's explicitly
// refreshed, it'll get out of step with the real file.
const LocalRef<jstring> t (javaString (file.getFullPathName()));
android.activity.callVoidMethod (JuceAppActivity.scanFile, t.get());
#endif


+ 1
- 0
modules/juce_data_structures/values/juce_ValueTree.cpp View File

@@ -987,6 +987,7 @@ ValueTree ValueTree::readFromStream (InputStream& input)
}
const int numChildren = input.readCompressedInt();
v.object->children.ensureStorageAllocated (numChildren);
for (int i = 0; i < numChildren; ++i)
{


Loading…
Cancel
Save